-
-
Notifications
You must be signed in to change notification settings - Fork 749
/
jest.config.js
26 lines (25 loc) · 939 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
// COVERAGE
const COVERAGE = process.env.COVERAGE;
module.exports = {
setupFiles: ["./tests/unit/setup.js"],
moduleFileExtensions: ["js", "jsx", "json", "vue", "md", "jpg"],
transform: {
".*\\.(vue|md)$": "<rootDir>/node_modules/vue-jest",
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
},
// 支持源代码中相同的 `@` -> `packages` 别名
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/packages/$1",
"^ve-table/(.*)$": "<rootDir>/$1", // map webpack externals comps
},
snapshotSerializers: ["<rootDir>/node_modules/jest-serializer-vue"],
coverageDirectory: "tests/unit/coverage",
collectCoverage: COVERAGE === "true",
collectCoverageFrom: [
"packages/ve-*/**/*.{jsx,js,vue}",
"!packages/ve-*/src/util/*",
"!packages/ve-checkbox-group/**",
"!packages/ve-table/src/selection/*",
"!**/node_modules/**",
],
};