-
Notifications
You must be signed in to change notification settings - Fork 3
/
jest.config.js
executable file
·28 lines (28 loc) · 949 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
27
28
// https://vue-test-utils.vuejs.org/guides/using-with-typescript.html
module.exports = {
// preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel',
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
moduleFileExtensions: [
"js",
"ts",
"json",
// tell Jest to handle `*.vue` files
"vue",
],
transform: {
// process `*.vue` files with `vue-jest`
".*\\.(vue)$": "vue-jest",
"^.+\\.tsx?$": "ts-jest",
},
testURL: "http://localhost/",
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
// https://stackoverflow.com/questions/42260218/jest-setup-syntaxerror-unexpected-token-export
"^lodash-es$": "lodash",
axios: "axios/dist/node/axios.cjs",
"\\.(css|scss)$": "<rootDir>/mocks/styleMock.js",
"vue-typeahead-bootstrap": "<rootDir>/mocks/vueMock.js",
},
setupFiles: ["<rootDir>/jest/envVars.js"],
setupFilesAfterEnv: ["<rootDir>/jest/jest.setup.js"],
};