-
Notifications
You must be signed in to change notification settings - Fork 8
/
jest.config.js
33 lines (33 loc) · 1.3 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
const path = require("path");
module.exports = {
// Where are your vue tests located?
"roots": [
"<rootDir>/tests/Vue"
],
// Make sure tests are run in a browser-like environment
"testEnvironment": "jsdom",
// vue: transform vue with vue-jest to make jest understand Vue's syntax
// js: transform js files with babel, we can now use import statements in tests
// ts: transform ts files with babel, to import ts files into js specs
"transform": {
".*\\.(vue)$": "<rootDir>/node_modules/@vue/vue3-jest",
"^.+\\.js$": "<rootDir>/node_modules/babel-jest",
"^.+\\.tsx?$": "<rootDir>/node_modules/ts-jest",
'.+\\.svg$': '<rootDir>/tests/Vue/helpers/jest-svg-component-transformer.js'
},
// (Optional) This file helps you later for global settings
"setupFilesAfterEnv": [
"<rootDir>tests/Vue/setup.js"
],
// (Optional) with that you can import your components like
// "import Counter from '@/Counter.vue'"
// (no need for a full path)
"moduleNameMapper": {
"^@/(.*)$": "<rootDir>/resources/js/$1",
},
// For Vue migration build
// Further info: https://test-utils.vuejs.org/migration/#-vue-vue3-jest-jest-28
"testEnvironmentOptions": {
"customExportConditions": ["node", "node-addons"],
}
}