Commit b999449e authored by Fatih Acet's avatar Fatih Acet

Merge branch 'improve-jest-config' into 'master'

Add additional check in Jest config

See merge request gitlab-org/gitlab!17443
parents c0505e1c 65fd5417
...@@ -19,7 +19,8 @@ let testMatch = ['<rootDir>/spec/frontend/**/*_spec.js', '<rootDir>/ee/spec/fron ...@@ -19,7 +19,8 @@ let testMatch = ['<rootDir>/spec/frontend/**/*_spec.js', '<rootDir>/ee/spec/fron
// workaround for eslint-import-resolver-jest only resolving in test files // workaround for eslint-import-resolver-jest only resolving in test files
// see https://github.com/JoinColony/eslint-import-resolver-jest#note // see https://github.com/JoinColony/eslint-import-resolver-jest#note
const isESLint = module.parent.filename.includes('/eslint-import-resolver-jest/'); const { filename: parentModuleName } = module.parent;
const isESLint = parentModuleName && parentModuleName.includes('/eslint-import-resolver-jest/');
if (isESLint) { if (isESLint) {
testMatch = testMatch.map(path => path.replace('_spec.js', '')); testMatch = testMatch.map(path => path.replace('_spec.js', ''));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment