summaryrefslogtreecommitdiff
path: root/jest.config.js
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2018-12-10 13:22:05 +0100
committerWinnie Hellmann <winnie@gitlab.com>2018-12-11 13:06:19 +0100
commitca3603de56445862b47cbc9b8eec50cbf82d71c3 (patch)
treeb03a11e754642fd63f9afb5866c6b712e96a3333 /jest.config.js
parent5c4cf3b3a37a2b97ff578ce6a1296e8fc1774abc (diff)
downloadgitlab-ce-ca3603de56445862b47cbc9b8eec50cbf82d71c3.tar.gz
Move jest.config.js to root directory
Diffstat (limited to 'jest.config.js')
-rw-r--r--jest.config.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/jest.config.js b/jest.config.js
new file mode 100644
index 00000000000..0a7b2aedb42
--- /dev/null
+++ b/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',
+ '^helpers(.*)$': '<rootDir>/spec/frontend/helpers$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,
+};