-
-
Notifications
You must be signed in to change notification settings - Fork 108
/
jest.config.cjs
42 lines (41 loc) · 1.3 KB
/
jest.config.cjs
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
// Tests can be added in the aw-webui/test folder
// File names that end with .test.js will be run in the jsdom testEnvironment
// File names that end with .test.node.js will be run in the node testEnvironment
module.exports = {
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{js,ts}'],
projects: [
{
displayName: 'jsdom',
preset: '@vue/cli-plugin-unit-jest',
testEnvironment: 'jsdom',
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.ts$': 'ts-jest',
'^.+\\.vue$': '@vue/vue2-jest',
},
testMatch: ['**/test/**/*.test.js?(x)'],
moduleNameMapper: {
'^~/(.+)$': '<rootDir>/src/$1',
'^d3$': '<rootDir>/node_modules/d3/dist/d3.min.js',
},
moduleFileExtensions: ['js', 'ts', 'vue', 'json'],
modulePathIgnorePatterns: ['test/e2e/screenshot.test.js'], // Don't run this file in npm test
},
{
displayName: 'node',
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/test/**/*.test.node.{js,ts}?(x)'],
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.ts$': 'ts-jest',
'^.+\\.vue$': '@vue/vue2-jest',
},
moduleNameMapper: {
'^~/(.+)$': '<rootDir>/src/$1',
'^d3$': '<rootDir>/node_modules/d3/dist/d3.min',
},
},
],
};