diff --git a/frontend/jest.setup.js b/frontend/jest.setup.js index 2acaf77..6f30ca7 100644 --- a/frontend/jest.setup.js +++ b/frontend/jest.setup.js @@ -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 diff --git a/frontend/playwright.config.ts b/frontend/playwright.config.ts index 03f6aa9..7c44fa0 100644 --- a/frontend/playwright.config.ts +++ b/frontend/playwright.config.ts @@ -20,7 +20,9 @@ export default defineConfig({ /* Limit workers to prevent test interference */ workers: process.env.CI ? 1 : 12, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', + reporter: process.env.CI ? 'github' : 'list', + /* Suppress console output unless VERBOSE=true */ + quiet: process.env.VERBOSE !== 'true', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */