-
Notifications
You must be signed in to change notification settings - Fork 134
/
jest.config.mjs
41 lines (39 loc) · 1.09 KB
/
jest.config.mjs
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
33
34
35
36
37
38
39
40
41
import { defaults } from 'jest-config'
// @type {import('jest-config').InitialOptions}
const config = {
rootDir: './',
moduleFileExtensions: [...defaults.moduleFileExtensions, 'mts'],
collectCoverage: false,
collectCoverageFrom: [
'packages/**/src/**/*.ts',
'!**/examples/**',
'!packages/cli/**',
'!**/types/**',
'!**/build/**',
'!**/node_modules/**',
'!packages/test-react-app/**',
'!packages/test-utils/**',
],
coverageReporters: ['json'],
coverageDirectory: './coverage',
coverageProvider: 'v8',
testMatch: ['**/__tests__/**/*.test.ts'],
automock: false,
// // typescript 5 removes the need to specify relative imports as .js, so we should no longer need this workaround
// // but webpack still requires .js specifiers, so we are keeping it for now
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.m?tsx?$': [
'ts-jest',
{
useESM: true,
tsconfig: './packages/tsconfig.settings.json',
},
],
},
extensionsToTreatAsEsm: ['.ts'],
testEnvironment: 'node',
}
export default config