summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/jest.config.js27
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
+};