Skip to content

Commit

Permalink
test(core): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton committed Mar 8, 2024
1 parent 28717cf commit 36306dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/utils/mocks/setup/cliui.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import {ui} from "../../src/lib/logging";
vi.mock('../../src/lib/logging', async () => {
const module = await vi.importActual('../../src/lib/logging');

module.ui().switchMode('raw')
(module['ui'] as () => {switchMode: (mode: string) => void})().switchMode('raw');
return module;
});

beforeEach(() => {
ui().logger.flushLogs();
ui().logger.flushLogs();
})
5 changes: 3 additions & 2 deletions testing/test-setup/src/lib/cliui.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { vi } from 'vitest';
vi.mock('@code-pushup/utils', async () => {
const module = await vi.importActual('@code-pushup/utils');

// eslint-disable-next-line @typescript-eslint/no-unsafe-call
module.ui().switchMode('raw');
(module['ui'] as () => { switchMode: (mode: string) => void })().switchMode(
'raw',
);
return module;
});

0 comments on commit 36306dc

Please sign in to comment.