Initial commit
This commit is contained in:
37
packages/config/vitest/index.js
Normal file
37
packages/config/vitest/index.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
/**
|
||||
* Creates a base Vitest config for a workspace package.
|
||||
*
|
||||
* @param {import('vitest/config').UserConfig} [overrides] - Package-specific overrides.
|
||||
* @returns {import('vitest/config').UserConfig}
|
||||
*/
|
||||
export function createVitestConfig(overrides = {}) {
|
||||
return defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['text', 'json', 'html'],
|
||||
thresholds: {
|
||||
lines: 85,
|
||||
functions: 85,
|
||||
branches: 85,
|
||||
statements: 85,
|
||||
},
|
||||
exclude: [
|
||||
'**/node_modules/**',
|
||||
'**/dist/**',
|
||||
'**/generated/**',
|
||||
'**/*.d.ts',
|
||||
'**/*.config.*',
|
||||
'**/index.ts',
|
||||
],
|
||||
},
|
||||
},
|
||||
...overrides,
|
||||
});
|
||||
}
|
||||
|
||||
export default createVitestConfig();
|
||||
Reference in New Issue
Block a user