提交 a5d4c587 编写于 作者: W Winnie Hellmann 提交者: Clement Ho

Workaround ESLint only resolving paths in test files

上级 863930cd
......@@ -15,9 +15,18 @@ if (process.env.CI) {
]);
}
let testMatch = ['<rootDir>/spec/frontend/**/*_spec.js', '<rootDir>/ee/spec/frontend/**/*_spec.js'];
// workaround for eslint-import-resolver-jest only resolving in test files
// see https://github.com/JoinColony/eslint-import-resolver-jest#note
const isESLint = module.parent.path.includes('/eslint-import-resolver-jest/');
if (isESLint) {
testMatch = testMatch.map(path => path.replace('_spec.js', ''));
}
// eslint-disable-next-line import/no-commonjs
module.exports = {
testMatch: ['<rootDir>/spec/frontend/**/*_spec.js', '<rootDir>/ee/spec/frontend/**/*_spec.js'],
testMatch,
moduleFileExtensions: ['js', 'json', 'vue'],
moduleNameMapper: {
'^~(/.*)$': '<rootDir>/app/assets/javascripts$1',
......
import createStore from '~/error_tracking_settings/store';
import { TEST_HOST } from '../helpers/test_constants';
import { TEST_HOST } from 'helpers/test_constants';
const defaultStore = createStore();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册