forked from js-tasks-ru/vue-20211004_maxim-b
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
51 lines (40 loc) · 1.46 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
44
45
46
47
48
49
50
51
const config = {
modulePaths: ['utility_modules'],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'vue'],
transform: {
// process *.vue files with vue-jest
'^.+\\.vue$': require.resolve('vue-jest'),
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': require.resolve('jest-transform-stub'),
'^.+\\.jsx?$': require.resolve('babel-jest'),
'^.+\\.tsx?$': require.resolve('ts-jest'),
},
transformIgnorePatterns: ['/node_modules/'],
moduleNameMapper: {
// Support the same @ -> src alias mapping in source code
'^@/(.*)$': '<rootDir>/src/$1',
// Use commonjs version of lodash in tests
'^lodash-es$': '<rootDir>/node_modules/lodash/index.js',
},
testEnvironment: 'jsdom',
// Serializer for Vue snapshots
snapshotSerializers: ['jest-serializer-vue'],
// Add taskbook utilities
setupFilesAfterEnv: ['<rootDir>/utility_modules/taskbook-jest-setup.js'],
testMatch: ['**/__tests__/**/*.(spec|test|student-test).[jt]s?(x)'],
// https://github.com/facebook/jest/issues/6766
testURL: 'http://localhost/',
// watchPlugins: [require.resolve('jest-watch-typeahead/filename'), require.resolve('jest-watch-typeahead/testname')],
globals: {
'ts-jest': {
babelConfig: true,
},
},
clearMocks: true,
};
if (process.env.TASK_MONITOR) {
Object.assign(config, {
testResultsProcessor: '<rootDir>/utility_modules/taskbook-test-results-processor.js',
reporters: [],
});
}
module.exports = config;