-
-
Notifications
You must be signed in to change notification settings - Fork 277
/
jest.config.js
42 lines (42 loc) · 1.11 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
module.exports = {
preset: 'ts-jest/presets/js-with-ts',
coverageReporters: ['lcov'],
coverageDirectory: './coverage',
roots: ['<rootDir>/test'],
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/?(*.)+(spec|test).+(ts|tsx|js)',
],
testPathIgnorePatterns: ["<rootDir>/test/playwright-tests/"],
// reporters: ['jest-silent-reporter'],
moduleNameMapper: {
'.*\\.(sass|less|css)$': '<rootDir>/test/__mocks__/styleMock.js',
},
moduleFileExtensions: ['js', 'json', 'ts', 'esm.js'],
transform: {
'^.+\\.js$': [
'ts-jest',
{
useESM: true,
isolatedModules: true,
tsconfig: {
allowJs: true,
module: 'system',
},
},
],
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
isolatedModules: true,
tsconfig: {
allowJs: true,
module: 'system',
},
},
],
},
// See https://stackoverflow.com/questions/58370492/ts-jest-fails-to-run-a-tsx-test-file-because-of-import-from-a-modules-js-file
transformIgnorePatterns: ['<rootDir>/node_modules/(?!(@cortex-js)/)'],
};