-
Notifications
You must be signed in to change notification settings - Fork 3
/
jest.config.js
45 lines (41 loc) · 1.21 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
38
39
40
41
42
43
44
45
/** @returns {Promise<import('jest').Config>} */
const esModules = [
'axios',
'query-string',
'decode-uri-component',
'split-on-first',
'filter-obj',
].join('|');
process.env.VUE_APP_SUPPORTED_LANGUAGES = 'en|pt';
process.env.VUE_APP_VERSION = '0.0.0';
process.env.VUE_APP_BOTHUB_NLP_BASE_URL = 'http://localhost:2657/';
process.env.VUE_APP_BOTHUB_WEBAPP_BASE_URL = 'http://localhost:8080/';
const config = {
setupFilesAfterEnv: ['./__tests__/jest.setup.js'],
rootDir: 'src/',
testMatch: ['**/__tests__/**/*.spec.js'],
verbose: true,
moduleNameMapper: {
'@/(.*)': '<rootDir>/$1',
'\\.css$': '<rootDir>/__tests__/__mocks__/styleMock.js',
'\\.(svg)$': '<rootDir>/__tests__/__mocks__/fileMock.js',
},
moduleDirectories: ['node_modules', 'src'],
testEnvironment: 'jsdom',
transformIgnorePatterns: [`/node_modules/(?!${esModules})`],
moduleFileExtensions: [
'js',
'json',
// tell Jest to handle `*.vue` files
'vue',
],
transform: {
// process `*.vue` files with `vue-jest`
'.*\\.(vue)$': 'vue-jest',
'.*\\.(js)$': 'babel-jest',
},
automock: false,
coverageReporters: ['text', 'json'],
coverageDirectory: '../tests/unit/coverage',
};
module.exports = config;