-
-
Notifications
You must be signed in to change notification settings - Fork 232
/
jest.config.js
30 lines (28 loc) · 929 Bytes
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Need to extend from a base config because projects don't inherit configurations as documented
// https://github.com/jestjs/jest/issues/11411
/** @type {import('@jest/types').Config.InitialProjectOptions} */
const baseConfig = {
transform: {
'.*': ['@swc/jest'],
},
testPathIgnorePatterns: ['/node_modules/', '/dist'],
};
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
collectCoverage: true,
projects: [
{
...baseConfig,
displayName: 'unit',
collectCoverageFrom: ['src/**/*.ts', '!src/index.ts'],
// (src|bin) doesn't seem to work on Windows
testMatch: ['src', 'bin'].map((dir) => `<rootDir>/${dir}/**/*.spec.ts`),
},
{
...baseConfig,
displayName: 'smoke',
testMatch: ['<rootDir>/tests/**/*.spec.ts'],
},
],
};
module.exports = config;