-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
46 lines (45 loc) · 1.45 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
// 'types.ts', 'index.ts', 'index.tsx' are supposed to not have any logic, just type definitions and exports
const coveragePathIgnorePatterns = ['types.ts', 'index.ts', 'index.tsx', '.d.ts', '/node_modules/']
/**
* @type {import('@jest/types').Config.InitialOptions}
*/
module.exports = {
coverageProvider: 'v8',
collectCoverageFrom: ['**/src/**/*.{js,jsx,ts,tsx}'],
projects: [
{
displayName: 'DOM',
coveragePathIgnorePatterns,
testEnvironment: `${__dirname}/jest.env-browser.js`,
testMatch: ['**/*.test.ts', '**/*.test.tsx'],
testPathIgnorePatterns: ['/node_modules/', '/.local/', '/.ignore/', '/dist/'],
// setupFilesAfterEnv: ['./jest.setup-browser.js'],
transform: {
'^.+\\.(t|j)sx?$': [
'@swc/jest',
{
jsc: {
transform: {
react: {
runtime: 'automatic',
},
},
},
},
],
},
transformIgnorePatterns: ['/node_modules/', '^.+\\.module\\.(css|sass|scss)$'],
},
{
displayName: 'NodeJS',
coveragePathIgnorePatterns,
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testPathIgnorePatterns: ['/node_modules/', '/.local/', '/.ignore/', '/dist/', '.dom.test.ts'],
transform: {
'^.+\\.(t|j)s$': ['@swc/jest'],
},
transformIgnorePatterns: ['/node_modules/', '^.+\\.module\\.(css|sass|scss)$'],
},
],
}