forked from arnog/mathlive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
32 lines (32 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
31
32
module.exports = {
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'jsdom',
coverageReporters: ['lcov'],
coverageDirectory: './coverage',
roots: ['<rootDir>/test'],
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/?(*.)+(spec|test).+(ts|tsx|js)',
],
// reporters: ['jest-silent-reporter'],
globals: {
'ts-jest': {
useESM: true,
isolatedModules: true,
tsconfig: {
allowJs: true,
module: 'system',
},
},
},
moduleNameMapper: {
'.*\\.(sass|less|css)$': '<rootDir>/test/__mocks__/styleMock.js',
},
moduleFileExtensions: ['js', 'json', 'ts', 'esm.js'],
transform: {
'^.+\\.js$': 'ts-jest',
'^.+\\.tsx?$': 'ts-jest',
},
// 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)/)'],
};