Skip to content

Commit f6e6c1a

Browse files
committed
test: add @vitest/cjs-lib to optimizeDeps
1 parent 9c0b789 commit f6e6c1a

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎test/coverage-test/test/cjs-dependency.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test('excludes Vite transforms done for CJS dependency', async () => {
77
coverage: {
88
reporter: 'json',
99
},
10-
})
10+
}, undefined, { optimizeDeps: { include: ['@vitest/cjs-lib'] } })
1111
const coverageMap = await readCoverageMap()
1212
const files = coverageMap.files()
1313

‎test/coverage-test/vitest.config.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const ISTANBUL_TESTS = 'test/**.istanbul.test.ts'
66
const CUSTOM_TESTS = 'test/**.custom.test.ts'
77
const UNIT_TESTS = 'test/**.unit.test.ts'
88
const BROWSER_TESTS = 'test/**.browser.test.ts'
9+
const FIXTURES = '**/fixtures/**'
910

1011
const config = defineConfig({
1112
test: {
@@ -31,6 +32,7 @@ export default defineConfig({
3132
UNIT_TESTS,
3233
CUSTOM_TESTS,
3334
BROWSER_TESTS,
35+
FIXTURES,
3436
],
3537
},
3638
},
@@ -47,6 +49,7 @@ export default defineConfig({
4749
UNIT_TESTS,
4850
CUSTOM_TESTS,
4951
BROWSER_TESTS,
52+
FIXTURES,
5053
],
5154
},
5255
},
@@ -58,6 +61,7 @@ export default defineConfig({
5861
name: { label: 'custom', color: 'yellow' },
5962
env: { COVERAGE_PROVIDER: 'custom' },
6063
include: [CUSTOM_TESTS],
64+
exclude: [FIXTURES],
6165
},
6266
},
6367

@@ -89,6 +93,7 @@ export default defineConfig({
8993
'**/query-param-transforms.test.ts',
9094
'**/test/cjs-dependency.test.ts',
9195
],
96+
exclude: [FIXTURES],
9297
},
9398
},
9499
{
@@ -118,6 +123,7 @@ export default defineConfig({
118123
'**/query-param-transforms.test.ts',
119124
'**/test/cjs-dependency.test.ts',
120125
],
126+
exclude: [FIXTURES],
121127
},
122128
},
123129

0 commit comments

Comments
 (0)