Skip to content

Commit fa74e58

Browse files
author
Szymon.Poltorak
committed
refactor(testing): include logger mock configs and adjust related tests
1 parent 38bc0bb commit fa74e58

File tree

5 files changed

+30
-35
lines changed

5 files changed

+30
-35
lines changed

packages/ci/vitest.int.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
/// <reference types="vitest" />
22
import { createIntTestConfig } from '../../testing/test-setup-config/src/index.js';
33

4-
export default createIntTestConfig('ci');
4+
let config = createIntTestConfig('ci');
5+
6+
config = {
7+
...config,
8+
test: {
9+
...config.test,
10+
setupFiles: [
11+
...(config.test!.setupFiles || []),
12+
'../../testing/test-setup/src/lib/logger.mock.ts',
13+
],
14+
},
15+
};
16+
17+
export default config;

packages/ci/vitest.unit.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
/// <reference types="vitest" />
22
import { createUnitTestConfig } from '../../testing/test-setup-config/src/index.js';
33

4-
export default createUnitTestConfig('ci');
4+
let config = createUnitTestConfig('ci');
5+
6+
config = {
7+
...config,
8+
test: {
9+
...config.test,
10+
setupFiles: [
11+
...(config.test!.setupFiles || []),
12+
'../../testing/test-setup/src/lib/logger.mock.ts',
13+
],
14+
},
15+
};
16+
17+
export default config;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const INT_TEST_SETUP_FILES = [
4040
'../../testing/test-setup/src/lib/console.mock.ts',
4141
'../../testing/test-setup/src/lib/reset.mocks.ts',
4242
'../../testing/test-setup/src/lib/chrome-path.mock.ts',
43-
'../../testing/test-setup/src/lib/logger.mock.ts',
4443
...CUSTOM_MATCHERS,
4544
] as const;
4645

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ describe('vitest-setup-files', () => {
4242
});
4343

4444
describe('integration test setup files', () => {
45-
it('should return exactly 8 setup files with essential mocks and custom matchers', () => {
45+
it('should return exactly 7 setup files with essential mocks and custom matchers', () => {
4646
const setupFiles = getSetupFiles('int');
4747

48-
expect(setupFiles).toHaveLength(8);
48+
expect(setupFiles).toHaveLength(7);
4949
expect(setupFiles).toContain(
5050
'../../testing/test-setup/src/lib/console.mock.ts',
5151
);
@@ -55,9 +55,6 @@ describe('vitest-setup-files', () => {
5555
expect(setupFiles).toContain(
5656
'../../testing/test-setup/src/lib/chrome-path.mock.ts',
5757
);
58-
expect(setupFiles).toContain(
59-
'../../testing/test-setup/src/lib/logger.mock.ts',
60-
);
6158
});
6259

6360
it('should include custom matchers for integration tests', () => {

tools/vitest-tsconfig-path-aliases.ts

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

0 commit comments

Comments
 (0)