Skip to content

Commit a089e05

Browse files
committed
add env var
1 parent 4f9b4ea commit a089e05

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

node_package/tests/jest.setup.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ if (typeof window !== 'undefined') {
6363
global.ReadableStreamDefaultReader = ReadableStreamDefaultReader;
6464
}
6565

66-
global.console.log('All calls to console have been disabled in jest.setup.js');
66+
if (!['yes', 'true', 'y', 't'].includes(process.env.ENABLE_JEST_CONSOLE || ''.toLowerCase())) {
67+
global.console.log('All calls to console have been disabled in jest.setup.js');
6768

68-
global.console = {
69-
log: jest.fn(),
70-
error: jest.fn(),
71-
warn: jest.fn(),
72-
info: jest.fn(),
73-
debug: jest.fn(),
74-
};
69+
global.console = {
70+
log: jest.fn(),
71+
error: jest.fn(),
72+
warn: jest.fn(),
73+
info: jest.fn(),
74+
debug: jest.fn(),
75+
};
76+
}

0 commit comments

Comments
 (0)