-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
executable file
·49 lines (48 loc) · 1.25 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
46
47
48
49
const esModules = ['quasar', 'quasar/lang', 'lodash-es'].join('|');
module.exports = {
globals: {
__DEV__: true,
},
// Jest assumes we are testing in node environment, specify jsdom environment instead
testEnvironment: 'node',
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons'],
},
// noStackTrace: true,
// bail: true,
// cache: false,
// verbose: true,
// watch: true,
testMatch: [
'<rootDir>/tests/unit/**/*.spec.js',
],
moduleFileExtensions: ['js', 'json'],
moduleNameMapper: {
'^~/(.*)$': '<rootDir>/$1',
'^src/(.*)$': '<rootDir>/src/$1',
},
moduleDirectories: [
'node_modules',
],
transform: {
'^.+\\.js?$': 'babel-jest',
},
testResultsProcessor: 'jest-sonar-reporter',
collectCoverage: true,
coverageDirectory: './reports',
collectCoverageFrom: [
'<rootDir>/src/**/*.js',
],
// Needed in JS codebases too because of feature flags
coveragePathIgnorePatterns: ['/node_modules/', '.d.ts$'],
coverageThreshold: {
global: {
// branches: 50,
// functions: 50,
// lines: 50,
// statements: 50
},
},
coverageReporters: ['lcov', 'cobertura', 'text-summary'],
transformIgnorePatterns: [`node_modules/(?!(${esModules}))`],
};