Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-12-05 13:43:38 +0300
committerMike Greiling <mike@pixelcog.com>2018-12-05 13:43:38 +0300
commitd133c874fa4c7b531b74ed8ac801022864c1f08f (patch)
tree59a2d5163dbcfdded7aa1c25d49ac2bb69739d28 /config
parent9816bb05a3d226dadbc4ed8f1d559f046879612b (diff)
parenta8a13d3259374a1b25ca4a3e954bca563a66a532 (diff)
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.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
+};