-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
jest.test.config.js
36 lines (35 loc) · 1.25 KB
/
jest.test.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
const { defaults: tsjPreset } = require('ts-jest/presets');
module.exports = {
displayName: 'test',
preset: 'ts-jest/presets/js-with-babel',
// Without this option, somehow CI fails to run the tests with the following error:
// TypeError: Unable to require `.d.ts` file.
// This is usually the result of a faulty configuration or import. Make sure there is a `.js`, `.json` or another executable extension available alongside `core.ts`.
// Fix is based on this comment:
// - https://github.com/kulshekhar/ts-jest/issues/805#issuecomment-456055213
// - https://github.com/kulshekhar/ts-jest/blob/master/docs/user/config/isolatedModules.md
transform: {
...tsjPreset.transform,
},
setupFiles: [
'raf/polyfill',
'jest-localstorage-mock',
'./throwing-console-patch.js',
],
setupFilesAfterEnv: ['./jest-runner-test.config.js'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
testEnvironment: 'jsdom',
testEnvironmentOptions: {
testURL: 'http://localhost',
},
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
testPathIgnorePatterns: [
'/node_modules/',
'/packages/.*/node_modules',
'/packages/.*/dist',
],
coveragePathIgnorePatterns: ['/node_modules/'],
};