-
Notifications
You must be signed in to change notification settings - Fork 42
/
jest.config.js
37 lines (36 loc) · 1.19 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
37
// Temporary workaround re: https://github.com/vuejs/vue-cli/issues/1879
process.env.VUE_CLI_BABEL_TARGET_NODE = true
process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true
process.env.VUE_APP_GRAPHQL_HTTP = 'http://test.io'
module.exports = {
automock: false,
timers: 'fake',
collectCoverageFrom: [
'src/**/*.{js,vue}',
'!**/node_modules/**',
'!**/dist/**',
'!src/main.js',
'!src/router.js'
],
coverageDirectory: 'tests/__coverage__',
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest'
},
moduleNameMapper: {
'\\.(css|scss|less)$': '<rootDir>/__mocks__/styleMock.js',
'^@/(.*)$': '<rootDir>/src/$1'
},
transformIgnorePatterns: ['<rootDir>/node_modules/'],
roots: ['src', 'tests'],
setupFiles: ['jest-localstorage-mock', 'jest-fetch-mock', 'jest-canvas-mock'],
setupFilesAfterEnv: ['<rootDir>/tests/jestSetup.js'],
snapshotSerializers: ['jest-serializer-vue'],
testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
],
testURL: 'http://localhost/'
}