-
Notifications
You must be signed in to change notification settings - Fork 381
Expand file tree
/
Copy pathjest.config.js
More file actions
52 lines (48 loc) · 1.55 KB
/
jest.config.js
File metadata and controls
52 lines (48 loc) · 1.55 KB
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
const path = require('path');
// Consistency for date formatting tests
process.env.TZ = 'UTC';
module.exports = {
rootDir: path.resolve(__dirname),
moduleDirectories: ['node_modules'],
moduleFileExtensions: ['web.jsx', 'web.js', 'wasm', 'jsx', 'js', 'json'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/tests/jest/file-mock.js',
'\\.(css|less|sass|scss)$': '<rootDir>/tests/jest/style-mock.js',
'^react-native$': '<rootDir>/node_modules/react-native-web',
'^react-resizable-panels$':
'<rootDir>/tests/jest/react-resizable-panels-mock.js',
'^@auth0/auth0-spa-js$':
'<rootDir>/tests/jest/auth0-spa-js-mock.js',
},
bail: true,
collectCoverageFrom: ['ui/**/*.{mjs,jsx,js}'],
testEnvironment: 'jsdom',
testRegex: 'ui/.*(_test|_spec|\\.test|\\.spec)\\.(mjs|jsx|js)$',
verbose: true,
// Use SWC for faster transforms (20-70x faster than babel-jest)
transform: {
'\\.(mjs|jsx|js)$': [
'@swc/jest',
{
jsc: {
parser: {
syntax: 'ecmascript',
jsx: true,
},
transform: {
react: {
runtime: 'automatic',
},
},
},
},
],
},
transformIgnorePatterns: ['node_modules/(?!taskcluster-client-web)'],
setupFilesAfterEnv: ['<rootDir>/tests/ui/test-setup.js'],
testPathIgnorePatterns: ['tests/ui/integration'],
// Enable Jest caching for faster subsequent runs
cache: true,
cacheDirectory: '<rootDir>/.jest-cache',
};