-
-
Notifications
You must be signed in to change notification settings - Fork 97
/
jest.config.js
48 lines (45 loc) · 1.28 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
43
44
45
46
47
48
const { jsWithBabel } = require('ts-jest/presets')
const esModules = [
'ansi-regex',
'array-union',
'chalk',
'chrome-launcher',
'find-up',
'globby',
'import-meta-resolve',
'is-inside-container',
'is-docker',
'is-wsl',
'lighthouse-logger',
'locate-path',
'nanoid',
'os-locale',
'p-limit',
'p-locate',
'path-exists',
'pkg-up',
'slash',
'strip-ansi',
'yocto-queue',
]
module.exports = {
collectCoverageFrom: ['src/**/*.ts', 'src/**/*.tsx'],
coveragePathIgnorePatterns: ['/node_modules/', '.*\\.d\\.ts'],
coverageProvider: 'v8',
coverageThreshold: { global: { lines: 95 } },
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFiles: ['./jest.setup.js'],
transform: {
...jsWithBabel.transform,
'\\.s?css$': '<rootDir>/test/_transformers/css.js',
'\\.png$': '<rootDir>/test/_transformers/png.js',
'\\.pug$': '<rootDir>/test/_transformers/pug.js',
// TODO: Remove if Jest did not fail on ESM dynamic imports
'custom-engine\\.mjs$': 'babel-jest',
'config\\.mjs$': 'babel-jest',
'esm-project/marp\\.config\\.js$': 'babel-jest',
},
transformIgnorePatterns: [`/node_modules/(?!${esModules.join('|')})`],
testEnvironment: 'node',
testRegex: '(/(test|__tests__)/(?![_.]).*|(\\.|/)(test|spec))\\.[jt]sx?$',
}