Skip to content

Commit eef4e0d

Browse files
committed
test: remove obsolete console mocks
1 parent 6c74e7f commit eef4e0d

File tree

5 files changed

+12
-36
lines changed

5 files changed

+12
-36
lines changed

packages/models/src/lib/implementation/schemas.unit.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ describe('weightSchema', () => {
3838
});
3939

4040
describe('docsUrlSchema', () => {
41+
beforeAll(() => {
42+
vi.spyOn(console, 'warn').mockImplementation(() => {});
43+
});
44+
4145
it('should accept a valid URL', () => {
4246
expect(() =>
4347
docsUrlSchema.parse(

packages/plugin-typescript/src/lib/utils.unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ describe('getCategoryRefsFromGroups', () => {
115115
});
116116

117117
describe('logSkippedAudits', () => {
118-
it('should not warn when all audits are included', () => {
118+
it('should not print anything when all audits are included', () => {
119119
logSkippedAudits(AUDITS);
120120

121-
expect(console.warn).not.toHaveBeenCalled();
121+
expect(logger.info).not.toHaveBeenCalled();
122122
});
123123

124124
it('should warn about skipped audits', () => {

testing/test-setup-config/src/lib/vitest-config-factory.unit.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ describe('createVitestConfig', () => {
2929
],
3030
globalSetup: ['../../global-setup.ts'],
3131
setupFiles: expect.arrayContaining([
32-
'../../testing/test-setup/src/lib/console.mock.ts',
3332
'../../testing/test-setup/src/lib/reset.mocks.ts',
3433
'../../testing/test-setup/src/lib/fs.mock.ts',
3534
]),
@@ -47,9 +46,6 @@ describe('createVitestConfig', () => {
4746
const config = createVitestConfig('test-package', 'unit');
4847

4948
const setupFiles = config.test!.setupFiles;
50-
expect(setupFiles).toContain(
51-
'../../testing/test-setup/src/lib/console.mock.ts',
52-
);
5349
expect(setupFiles).toContain(
5450
'../../testing/test-setup/src/lib/reset.mocks.ts',
5551
);
@@ -121,9 +117,6 @@ describe('createVitestConfig', () => {
121117
const config = createVitestConfig('test-package', 'int');
122118

123119
const setupFiles = config.test!.setupFiles;
124-
expect(setupFiles).toContain(
125-
'../../testing/test-setup/src/lib/console.mock.ts',
126-
);
127120
expect(setupFiles).toContain(
128121
'../../testing/test-setup/src/lib/logger.mock.ts',
129122
);
@@ -172,9 +165,9 @@ describe('createVitestConfig', () => {
172165
expect(setupFiles).toContain(
173166
'../../testing/test-setup/src/lib/reset.mocks.ts',
174167
);
175-
// Should NOT include console, fs, git, etc.
168+
// Should NOT include fs, git, etc.
176169
expect(setupFiles).not.toContain(
177-
'../../testing/test-setup/src/lib/console.mock.ts',
170+
'../../testing/test-setup/src/lib/git.mock.ts',
178171
);
179172
expect(setupFiles).not.toContain(
180173
'../../testing/test-setup/src/lib/fs.mock.ts',

testing/test-setup-config/src/lib/vitest-setup-files.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import type { TestKind } from './vitest-config-factory.js';
77
* which is why they use `../../` to navigate to the workspace root first.
88
*/
99
const CUSTOM_MATCHERS = [
10-
'../../testing/test-setup/src/lib/extend/markdown-table.matcher.ts',
1110
'../../testing/test-setup/src/lib/extend/jest-extended.matcher.ts',
1211
'../../testing/test-setup/src/lib/extend/path.matcher.ts',
12+
'../../testing/test-setup/src/lib/extend/markdown-table.matcher.ts',
1313
] as const;
1414

1515
/**
@@ -19,12 +19,11 @@ const CUSTOM_MATCHERS = [
1919
* which is why they use `../../` to navigate to the workspace root first.
2020
*/
2121
const UNIT_TEST_SETUP_FILES = [
22-
'../../testing/test-setup/src/lib/fs.mock.ts',
23-
'../../testing/test-setup/src/lib/console.mock.ts',
2422
'../../testing/test-setup/src/lib/reset.mocks.ts',
23+
'../../testing/test-setup/src/lib/fs.mock.ts',
24+
'../../testing/test-setup/src/lib/logger.mock.ts',
2525
'../../testing/test-setup/src/lib/git.mock.ts',
2626
'../../testing/test-setup/src/lib/portal-client.mock.ts',
27-
'../../testing/test-setup/src/lib/logger.mock.ts',
2827
...CUSTOM_MATCHERS,
2928
] as const;
3029

@@ -36,10 +35,9 @@ const UNIT_TEST_SETUP_FILES = [
3635
3736
*/
3837
const INT_TEST_SETUP_FILES = [
39-
'../../testing/test-setup/src/lib/console.mock.ts',
4038
'../../testing/test-setup/src/lib/reset.mocks.ts',
41-
'../../testing/test-setup/src/lib/chrome-path.mock.ts',
4239
'../../testing/test-setup/src/lib/logger.mock.ts',
40+
'../../testing/test-setup/src/lib/chrome-path.mock.ts',
4341
...CUSTOM_MATCHERS,
4442
] as const;
4543

testing/test-setup/src/lib/console.mock.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)