-
Notifications
You must be signed in to change notification settings - Fork 66
/
jest.config.js
43 lines (43 loc) · 1.35 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
module.exports = {
verbose: true,
testEnvironment: 'jsdom',
testTimeout: 10000,
moduleDirectories: ['node_modules', 'src'],
modulePaths: ['<rootDir>/src'],
roots: ['<rootDir>/src'],
transform: {
'^.+\\.(ts|js|tsx|jsx)$': ['@swc/jest'],
'^.+\\.scss$': 'jest-scss-transform',
'^.+\\.svg$': '<rootDir>/config/svgTransform.js'
},
transformIgnorePatterns: ['node_modules/(^.+\\\\.(ts|js|tsx|jsx)$)'],
testMatch: [
'**/__tests__/**/*.[jt]s?(x)',
'**/?(*.)+(spec|test|bgTest).[jt]s?(x)'
],
moduleNameMapper: {
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$':
'identity-obj-proxy',
uint8arrays: '<rootDir>/node_modules/uint8arrays/cjs/src',
multiformats: '<rootDir>/node_modules/multiformats/cjs/src'
},
setupFilesAfterEnv: ['<rootDir>/src/setupTests.js'],
moduleFileExtensions: [
// Place tsx and ts to beginning as suggestion from Jest team
// https://jestjs.io/docs/configuration#modulefileextensions-arraystring
'tsx',
'ts',
'web.js',
'js',
'web.ts',
'web.tsx',
'json',
'node'
],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname'
],
workerIdleMemoryLimit: '512MB', // Memory used per worker. Required to prevent memory leaks
maxWorkers: '50%' // Maximum tests ran in parallel. Required to prevent CPU usage at 100%
};