Skip to content

Commit

Permalink
Override loglevel to error for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rpanic committed Nov 9, 2024
1 parent b963a9a commit 0cb783e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/pull-request-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ jobs:

- name: "Test"
run: npm run test:ci
env:
IN_CI: true

integration:
runs-on: ubuntu-latest
Expand Down
10 changes: 9 additions & 1 deletion packages/common/src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ function logProvable(
}
/* eslint-enable */

// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (process.env?.IN_CI ?? false) {
loglevel.setLevel("ERROR");
}

export const log = {
provable: {
info: (...args: unknown[]) => {
Expand Down Expand Up @@ -73,7 +78,10 @@ export const log = {
},

setLevel: (level: LogLevelDesc) => {
loglevel.setLevel(level);
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (!(process.env?.IN_CI ?? false)) {
loglevel.setLevel(level);
}
},

get levels() {
Expand Down

0 comments on commit 0cb783e

Please sign in to comment.