-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
32 lines (32 loc) · 924 Bytes
/
Copy pathjest.config.js
File metadata and controls
32 lines (32 loc) · 924 Bytes
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
31
32
export default {
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts'],
// NodeNext source imports carry .js extensions; map them back to .ts.
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.ts$': [
'ts-jest',
{
useESM: true,
},
],
},
testRegex: '(/tests/.*|(\\.|/)(test|spec))\\.(?!d\\.ts$)ts$',
// tests/*.spec.js|.d.ts are committed build artifacts, not suites.
// build.spec.ts / main.spec.ts hit the live Shipthis API and need real
// credentials, so they are excluded from the offline suite.
testPathIgnorePatterns: [
'/node_modules/',
'/dist/',
'\\.d\\.ts$',
'/tests/.*\\.spec\\.js$',
'/tests/build\\.spec\\.ts$',
'/tests/main\\.spec\\.ts$',
],
coverageDirectory: 'coverage',
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts'],
testTimeout: 30000,
};