-
Notifications
You must be signed in to change notification settings - Fork 671
/
jest.config.js
62 lines (60 loc) · 1.49 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
50
51
52
53
54
55
56
57
58
59
60
61
62
// @ts-check
/** @typedef {import('ts-jest/dist/types')} */
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
preset: 'ts-jest/presets/js-with-ts',
transform: {
'^.+.tsx?$': [
'ts-jest',
{
isolatedModules: true,
tsconfig: {
tsconfig: './tsconfig.test.json',
useESM: true,
diagnostics: {
exclude: ['**'],
},
},
},
],
'^.+\\.m?jsx?$': '<rootDir>/jest-preprocess.js',
},
testMatch: ['**/packages/**/test/*.{js,ts,tsx,mjs}'],
testPathIgnorePatterns: [
'/node_modules/',
'/fixtures/',
'/presets/',
'/style-guide/',
'tailwind.config.js',
'/dist/',
'/__test-utils__/',
],
coverageReporters: ['lcov', 'text', 'html'],
coverageProvider: 'v8',
collectCoverageFrom: [
'packages/**/src/**/*.{js,ts,tsx}',
'!packages/docs/**/*',
'!packages/presets/**/*',
'!packages/style-guide/**/*',
'!packages/gatsby-theme-style-guide/**/*',
'!packages/chrome/**/*',
'!packages/gatsby-theme-*/**/*',
'!packages/preset-*/**/*',
'!packages/test-utils/**/*',
],
coverageThreshold: {
global: {
branches: 90,
functions: 90,
lines: 90,
statements: 90,
},
},
modulePathIgnorePatterns: ['packages/.*/dist'],
snapshotSerializers: ['@emotion/jest/serializer'],
setupFiles: ['jest-canvas-mock'],
moduleNameMapper: {
'@theme-ui/css/dist/types': '@theme-ui/css/src/types',
},
}
module.exports = config