forked from tdeekens/flopflip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.test.config.js
31 lines (31 loc) · 1.15 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
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
globals: {
'ts-jest': {
isolatedModules: true,
},
},
setupFiles: [
'raf/polyfill',
'jest-localstorage-mock',
'./throwing-console-patch.js',
],
setupFilesAfterEnv: ['./jest-runner-test.config.js'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
testEnvironment: 'jsdom',
testURL: 'http://localhost',
watchPlugins: ['jest-plugin-filename', 'jest-watch-yarn-workspaces'],
testPathIgnorePatterns: [
'/node_modules/',
'/packages/.*/node_modules',
'/packages/.*/dist',
],
coveragePathIgnorePatterns: ['/node_modules/'],
};