diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2018-08-29 22:45:53 +0200 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2018-12-05 09:24:42 +0100 |
commit | a8a13d3259374a1b25ca4a3e954bca563a66a532 (patch) | |
tree | fd579414080576ea8fa0305645d29d325372f6f2 /config | |
parent | 8cd5004b350ef342f66956c11272dad1328f6526 (diff) | |
download | gitlab-ce-a8a13d3259374a1b25ca4a3e954bca563a66a532.tar.gz |
Setup Jest test environment
Diffstat (limited to 'config')
-rw-r--r-- | config/jest.config.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/config/jest.config.js b/config/jest.config.js new file mode 100644 index 00000000000..23e62f49be1 --- /dev/null +++ b/config/jest.config.js @@ -0,0 +1,27 @@ +/* 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'], + moduleNameMapper: { + '^~(.*)$': '<rootDir>/app/assets/javascripts$1', + }, + 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, + rootDir: '..', // necessary because this file is in the config/ subdirectory +}; |