-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
36 lines (36 loc) · 1.16 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 = {
preset: "@vue/cli-plugin-unit-jest",
moduleFileExtensions: ["js", "jsx", "json", "vue"],
transform: {
"^.+\\.vue$": "vue-jest",
".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$":
"jest-transform-stub",
"^.+\\.(js|jsx)?$": "babel-jest"
},
transformIgnorePatterns: ["/node_modules/"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
"\\.(css|less|scss|sss|styl)$": "<rootDir>/node_modules/jest-css-modules",
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/tests/__mocks__/fileMock.js"
},
snapshotSerializers: ["jest-serializer-vue"],
testMatch: ["**/tests/unit/**/*.[jt]s?(x)", "**/__tests__/**/*.[jt]s?(x)"],
testURL: "http://localhost/",
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
],
//TEST COVERAGE
coverageDirectory: "tests/coverage",
collectCoverage: true,
collectCoverageFrom: [
"**/*.{js,vue}",
"!**/node_modules/**",
"!<rootDir>/dist/**",
"!<rootDir>/src/plugins/**",
"!<rootDir>/tests/**",
"!**/__tests__/**"
],
coverageReporters: ["lcov", "text-summary"]
};