-
Notifications
You must be signed in to change notification settings - Fork 31
/
jest.config.js
42 lines (41 loc) · 952 Bytes
/
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
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
module.exports = {
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
setupFiles: [],
testMatch: [
'<rootDir>/src/**/__tests__/**/*.(j|t)s?(x)',
'<rootDir>/tests/**/?(*.)(spec|test).(j|t)s?(x)',
'<rootDir>/__tests__/**/?(*.)(spec|test).(j|t)s?(x)'
],
testEnvironment: 'node',
testURL: 'http://localhost:4444',
transform: {
'^.+\\.(js|jsx|mjs)$': 'babel-jest',
'^.+\\.tsx?$': 'ts-jest'
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|ts|tsx)$'],
moduleNameMapper: {
'^src(.*)$': '<rootDir>/src/$1'
},
moduleFileExtensions: [
'h5.ts',
'web.ts',
'ts',
'h5.tsx',
'web.tsx',
'tsx',
'web.js',
'js',
'web.jsx',
'jsx',
'json',
'node',
'mjs'
],
globals: {
'ts-jest': {
tsConfig: path.join(__dirname, 'tsconfig.test.json')
}
}
};