2020-04-21 01:19:27 +00:00
|
|
|
module.exports = {
|
2020-06-04 23:46:30 +00:00
|
|
|
globals: {
|
|
|
|
__DEV__: true
|
|
|
|
},
|
|
|
|
setupFilesAfterEnv: [
|
|
|
|
'<rootDir>/test/jest/jest.setup.js'
|
|
|
|
],
|
|
|
|
// noStackTrace: true,
|
|
|
|
// bail: true,
|
|
|
|
// cache: false,
|
|
|
|
// verbose: true,
|
|
|
|
// watch: true,
|
2020-06-05 18:30:14 +00:00
|
|
|
collectCoverage: false,
|
2020-06-04 23:46:30 +00:00
|
|
|
coverageDirectory: '<rootDir>/test/jest/coverage',
|
|
|
|
collectCoverageFrom: [
|
|
|
|
'<rootDir>/src/**/*.vue',
|
|
|
|
'<rootDir>/src/**/*.js',
|
|
|
|
'<rootDir>/src/**/*.ts',
|
|
|
|
'<rootDir>/src/**/*.jsx'
|
|
|
|
],
|
|
|
|
coverageThreshold: {
|
|
|
|
global: {
|
|
|
|
// branches: 50,
|
|
|
|
// functions: 50,
|
|
|
|
// lines: 50,
|
|
|
|
// statements: 50
|
|
|
|
}
|
|
|
|
},
|
|
|
|
testMatch: [
|
|
|
|
'<rootDir>/test/jest/__tests__/**/*.spec.js',
|
|
|
|
'<rootDir>/test/jest/__tests__/**/*.test.js',
|
|
|
|
'<rootDir>/src/**/__tests__/*_jest.spec.js'
|
|
|
|
],
|
|
|
|
moduleFileExtensions: [
|
|
|
|
'vue',
|
|
|
|
'js',
|
|
|
|
'jsx',
|
|
|
|
'json',
|
|
|
|
'ts',
|
|
|
|
'tsx'
|
|
|
|
],
|
2020-05-07 03:42:42 +00:00
|
|
|
moduleNameMapper: {
|
2020-06-04 23:46:30 +00:00
|
|
|
'^vue$': '<rootDir>/node_modules/vue/dist/vue.common.js',
|
|
|
|
'^test-utils$': '<rootDir>/node_modules/@vue/test-utils/dist/vue-test-utils.js',
|
|
|
|
'^quasar$': '<rootDir>/node_modules/quasar/dist/quasar.common.js',
|
|
|
|
'^~/(.*)$': '<rootDir>/$1',
|
2020-06-05 18:30:14 +00:00
|
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
2020-06-04 23:46:30 +00:00
|
|
|
'^src/(.*)$': '<rootDir>/src/$1',
|
2020-06-05 18:30:14 +00:00
|
|
|
'.*css$': '<rootDir>/test/jest/utils/stub.css',
|
|
|
|
|
2020-06-04 23:46:30 +00:00
|
|
|
},
|
|
|
|
transform: {
|
|
|
|
'.*\\.vue$': 'vue-jest',
|
|
|
|
'.*\\.js$': 'babel-jest',
|
|
|
|
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
|
|
|
|
// use these if NPM is being flaky
|
2020-06-05 18:30:14 +00:00
|
|
|
//'.*\\.vue$': '<rootDir>/node_modules/@quasar/quasar-app-extension-testing-unit-jest/node_modules/vue-jest',
|
|
|
|
//'.*\\.js$': '<rootDir>/node_modules/@quasar/quasar-app-extension-testing-unit-jest/node_modules/babel-jest'
|
2020-05-07 03:42:42 +00:00
|
|
|
},
|
2020-06-04 23:46:30 +00:00
|
|
|
transformIgnorePatterns: [
|
|
|
|
'<rootDir>/node_modules/(?!quasar/lang)'
|
|
|
|
],
|
|
|
|
snapshotSerializers: [
|
|
|
|
'<rootDir>/node_modules/jest-serializer-vue'
|
|
|
|
]
|
2020-04-21 01:19:27 +00:00
|
|
|
}
|