2018-08-29 20:45:53 +00:00
|
|
|
/* eslint-disable filenames/match-regex */
|
|
|
|
|
|
|
|
const reporters = ['default'];
|
|
|
|
|
|
|
|
if (process.env.CI) {
|
|
|
|
reporters.push([
|
|
|
|
'jest-junit',
|
|
|
|
{
|
|
|
|
output: './junit_jest.xml',
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// eslint-disable-next-line import/no-commonjs
|
|
|
|
module.exports = {
|
|
|
|
testMatch: ['<rootDir>/spec/frontend/**/*_spec.js'],
|
2018-12-10 11:08:55 +00:00
|
|
|
moduleFileExtensions: ['js', 'json', 'vue'],
|
2018-08-29 20:45:53 +00:00
|
|
|
moduleNameMapper: {
|
|
|
|
'^~(.*)$': '<rootDir>/app/assets/javascripts$1',
|
2018-12-10 12:21:13 +00:00
|
|
|
'^helpers(.*)$': '<rootDir>/spec/frontend/helpers$1',
|
2018-08-29 20:45:53 +00:00
|
|
|
},
|
|
|
|
collectCoverageFrom: ['<rootDir>/app/assets/javascripts/**/*.{js,vue}'],
|
|
|
|
coverageDirectory: '<rootDir>/coverage-frontend/',
|
|
|
|
coverageReporters: ['json', 'lcov', 'text-summary', 'clover'],
|
|
|
|
cacheDirectory: '<rootDir>/tmp/cache/jest',
|
|
|
|
modulePathIgnorePatterns: ['<rootDir>/.yarn-cache/'],
|
|
|
|
reporters,
|
2018-09-06 17:36:04 +00:00
|
|
|
setupTestFrameworkScriptFile: '<rootDir>/spec/frontend/test_setup.js',
|
2018-12-11 11:18:42 +00:00
|
|
|
restoreMocks: true,
|
2018-12-10 11:08:55 +00:00
|
|
|
transform: {
|
|
|
|
'^.+\\.js$': 'babel-jest',
|
|
|
|
'^.+\\.vue$': 'vue-jest',
|
|
|
|
},
|
2019-02-20 20:27:23 +00:00
|
|
|
transformIgnorePatterns: ['node_modules/(?!(@gitlab/ui)/)'],
|
2018-08-29 20:45:53 +00:00
|
|
|
};
|