-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
36 lines (29 loc) · 1.17 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
module.exports = {
// Automatically clear mock calls and instances between every test
clearMocks: true,
// A map from regular expressions to paths to transformers
transform: {
'^.+\\.(ts|tsx|js|jsx)$': [
'babel-jest', {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
['@babel/preset-typescript']
],
plugins: ['@vue/babel-plugin-jsx']
}
]
},
// The glob patterns Jest uses to detect test files
testMatch: ['**/**/*.spec.(ts|tsx)'],
// An array of file extensions your modules use
moduleFileExtensions: ['js', 'json', 'ts', 'tsx'],
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: {
'\\.(css|less|scss|sass)$': '<rootDir>/__mocks__/style-mock.ts',
'\\.(gif|ttf|eot|svg|jpg|png)$': '<rootDir>/__mocks__/file-mock.ts',
},
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: ['/node_modules/'],
// The test environment that will be used for testing
testEnvironment: 'jest-environment-jsdom'
};