Skip to content

Commit

Permalink
Try to fix coverage for console
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahkagan committed Dec 10, 2024
1 parent c19552c commit 9112d6c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libs/test-utils-vitest/src/console.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
/* eslint-disable no-console */
import { expect, test } from 'vitest';
import { beforeAll, expect, test } from 'vitest';
import { suppressingConsoleOutput } from './console';

// Ensure that console output suppression is enabled so that we can test it and
// get accurate coverage reporting. E.g. if it's disabled in general in CI for
// other packages, we still want to enable it for these tests.
beforeAll(() => {
process.env['SUPPRESS_CONSOLE_OUTPUT'] = 'true';
});

test.each(['log', 'warn', 'error'] as const)(
'suppressingConsoleOutput replaces console.%s with a mock',
(method) => {
Expand Down

0 comments on commit 9112d6c

Please sign in to comment.