-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
34 lines (33 loc) · 1.2 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
const paths = require('./config/paths');
module.exports = {
verbose: true,
collectCoverageFrom: ['src/**/*.{js,jsx,mjs,ts,tsx}'],
setupFiles: [
'<rootDir>/node_modules/regenerator-runtime/runtime',
'<rootDir>/config/polyfills.js',
],
// A list of paths to modules that run some code to configure
// or set up the testing framework before each test.
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx,mjs,ts,tsx}',
'<rootDir>/src/**/?(*.)(spec|test).{js,jsx,mjs,ts,tsx}',
],
testEnvironment: 'jsdom',
testURL: 'http://localhost',
modulePaths: ['src'],
moduleNameMapper: {
// '/^@/(.*)$/': '<rootDir>/src$1',
/**
* @link https://github.com/vuejs-templates/webpack/issues/807
*/
'^~[/](.+)': '<rootDir>/src/$1',
},
transform: {
'^.+\\.(js|jsx|mjs|ts|tsx)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|mjs|css|json|ts|tsx)$)': '<rootDir>/config/jest/fileTransform.js',
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|ts|tsx)$'],
moduleDirectories: paths.resolveModules,
moduleFileExtensions: ['js', 'json', 'jsx', 'node', 'mjs', 'ts', 'tsx'],
};