-
Notifications
You must be signed in to change notification settings - Fork 8
/
jest.config.js
30 lines (29 loc) · 1.18 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
require('dotenv').config({ path: './.env.test' });
module.exports = {
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'jsdom',
collectCoverage: true,
/**
* Tell jest to ignore transforming most node_modules
* except for the ones that match the module strings listed here.
* This is necessary for node modules that distribute their source code as uncompiled JS.
*/
transformIgnorePatterns: [
'node_modules/(?!(three|unist-.*|hast-.*|rehype-slug|remark-rehype|react-markdown|vfile.*|unified|bail|is-plain-obj|trough|remark-parse|mdast-.*|micromark.*|decode-named-character-reference|unist-.*|character-entities|property-information|space-separated-tokens|comma-separated-tokens)/)'
],
modulePaths: ['<rootDir>'],
moduleDirectories: ['node_modules', '<rootDir>'],
moduleNameMapper: {
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/src/mocks/fileMock.js',
'\\.(css|less)$': '<rootDir>/src/mocks/fileMock.js'
},
coverageReporters: ['json', 'html'],
setupFilesAfterEnv: ['./src/jest-setup.ts'],
globals: {
'ts-jest': {
tsConfig: './tsconfig.json',
isolatedModules: true
}
}
};