-
-
Notifications
You must be signed in to change notification settings - Fork 109
/
jest.config.js
49 lines (46 loc) · 1.23 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
49
const { createJsWithBabelPreset } = require('ts-jest')
const jsWithBabel = createJsWithBabelPreset()
const esModules = [
'@sindresorhus/merge-streams',
'ansi-regex',
'array-union',
'chalk',
'chrome-launcher',
'find-up',
'globby',
'import-meta-resolve',
'is-docker',
'is-inside-container',
'is-wsl',
'lighthouse-logger',
'locate-path',
'nanoid',
'os-locale',
'p-limit',
'p-locate',
'path-exists',
'path-type',
'package-up',
'slash',
'strip-ansi',
'unicorn-magic',
'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'],
prettierPath: null,
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',
},
transformIgnorePatterns: [`/node_modules/(?!${esModules.join('|')})`],
testEnvironment: 'node',
testRegex: '(/(test|__tests__)/(?![_.]).*|(\\.|/)(test|spec))\\.[jt]sx?$',
}