diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-12-05 10:43:38 +0000 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-12-05 10:43:38 +0000 |
commit | d133c874fa4c7b531b74ed8ac801022864c1f08f (patch) | |
tree | 59a2d5163dbcfdded7aa1c25d49ac2bb69739d28 /config | |
parent | 9816bb05a3d226dadbc4ed8f1d559f046879612b (diff) | |
parent | a8a13d3259374a1b25ca4a3e954bca563a66a532 (diff) | |
download | gitlab-ce-d133c874fa4c7b531b74ed8ac801022864c1f08f.tar.gz |
Merge branch 'winh-add-jest' into 'master'
Setup Jest test environment
See merge request gitlab-org/gitlab-ce!23406
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 +}; |