Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion testing/test-setup-config/src/lib/vitest-config-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,28 @@ function buildCoverageConfig(
return undefined;
}

const exclude = ['mocks/**', '**/types.ts', 'perf/**'];
const exclude = [
'mocks/**',
'perf/**',
Comment thread
BioPhoton marked this conversation as resolved.
Outdated
// Vitest configuration files
'**/vitest.*.config.ts',
'**/vitest.config.ts',
// code-pushup config
'**/code-pushup.config.ts',
// other config files
'**/*.config.ts',
// Barrel files (index files that only re-export)
'**/index.ts',
'**/index.js',
'**/index.mjs',
// Model files
'**/models.ts',
'**/*.model.ts',
'**/types.ts',
'**/*.types.ts',
Comment thread
BioPhoton marked this conversation as resolved.
Outdated
// typings
'**/*.d.ts',
];
const reportsDirectory = `../../coverage/${projectKey}/${kind}-tests`;

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,22 @@ describe('createVitestConfig', () => {
coverage: expect.objectContaining({
reporter: ['text', 'lcov'],
reportsDirectory: '../../coverage/test-package/unit-tests',
exclude: ['mocks/**', '**/types.ts', 'perf/**'],
exclude: [
'mocks/**',
'perf/**',
'**/vitest.*.config.ts',
'**/vitest.config.ts',
'**/code-pushup.config.ts',
'**/*.config.ts',
'**/index.ts',
'**/index.js',
'**/index.mjs',
'**/models.ts',
'**/*.model.ts',
'**/types.ts',
'**/*.types.ts',
'**/*.d.ts',
],
}),
typecheck: { include: ['**/*.type.test.ts'] },
}),
Expand Down Expand Up @@ -271,8 +286,19 @@ describe('createVitestConfig', () => {

expect(config.test!.coverage!.exclude).toEqual([
'mocks/**',
'**/types.ts',
'perf/**',
'**/vitest.*.config.ts',
'**/vitest.config.ts',
'**/code-pushup.config.ts',
'**/*.config.ts',
'**/index.ts',
'**/index.js',
'**/index.mjs',
'**/models.ts',
'**/*.model.ts',
'**/types.ts',
'**/*.types.ts',
'**/*.d.ts',
]);
});
});
Expand Down