Suppress non-essential console output in tests unless VERBOSE=true; adjust Playwright config to respect verbosity settings and use appropriate reporter.
This commit is contained in:
@@ -87,6 +87,20 @@ global.sessionStorage = {
|
||||
key: jest.fn(),
|
||||
};
|
||||
|
||||
// Suppress console logs during tests (unless VERBOSE=true)
|
||||
const VERBOSE = process.env.VERBOSE === 'true';
|
||||
|
||||
if (!VERBOSE) {
|
||||
global.console = {
|
||||
...console,
|
||||
log: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
info: jest.fn(),
|
||||
warn: jest.fn(),
|
||||
error: jest.fn(),
|
||||
};
|
||||
}
|
||||
|
||||
// Reset storage mocks before each test
|
||||
beforeEach(() => {
|
||||
// Don't use clearAllMocks - it breaks the mocks
|
||||
|
||||
Reference in New Issue
Block a user