-
Notifications
You must be signed in to change notification settings - Fork 671
/
jest.config.ts
59 lines (56 loc) · 1.4 KB
/
jest.config.ts
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
// @ts-check
import type { JestConfigWithTsJest } from 'ts-jest'
const config: JestConfigWithTsJest = {
preset: 'ts-jest',
transform: {
'^.+.tsx?$': [
'ts-jest',
{
tsconfig: './tsconfig.test.json',
},
],
'^.+\\.m?jsx?$': '<rootDir>/jest-preprocess.js',
},
testMatch: [
'**/packages/**/test/*.{js,ts,tsx,mjs}',
'**/packages/*/src/**/*.spec.{js,ts,tsx,mjs}',
],
testPathIgnorePatterns: [
'/node_modules/',
'/fixtures/',
'/presets/',
'/style-guide/',
'tailwind.config.js',
'/dist/',
'/__test-utils__/',
'/node_modules/(?!(@babel/runtime|gatsby))',
],
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