-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
42 lines (38 loc) · 1.11 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
module.exports = {
testEnvironment: 'node', // or 'jsdom',
rootDir: '.',
roots: ['<rootDir>/test/', '<rootDir>/src/'],
testMatch: ['**/*.spec.{js,jsx,ts,tsx}'],
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/test/web/'],
coverageDirectory: '<rootDir>/coverage',
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
coverageProvider: 'v8',
// enable this for real typescript builds (slow but accurate)
// preset: 'ts-jest',
// enable this for fast, correct sourcemaps but not all features supported
transform: {
'\\.(js|jsx|ts|tsx)$': [
'@stagas/sucrase-jest-plugin',
{
jsxPragma: 'h',
jsxFragmentPragma: 'Fragment',
production: true,
disableESTransforms: true,
},
],
},
// enable this for fast, incorrect sourcemaps but more features supported
// transform: {
// '\\.(js|jsx|ts|tsx)$': [
// '@swc-node/jest',
// {
// experimentalDecorators: true,
// emitDecoratorMetadata: true,
// react: {
// pragma: 'h',
// pragmaFrag: 'Fragment',
// },
// },
// ],
// },
}