diff options
Diffstat (limited to 'jest.config.js')
-rw-r--r-- | jest.config.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/jest.config.js b/jest.config.js index 646648c6928..34581c6532a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -41,6 +41,7 @@ module.exports = { '^vendor(/.*)$': '<rootDir>/vendor/assets/javascripts$1', '\\.(jpg|jpeg|png|svg)$': '<rootDir>/spec/frontend/__mocks__/file_mock.js', 'emojis(/.*).json': '<rootDir>/fixtures/emojis$1.json', + '^spec/test_constants$': '<rootDir>/spec/frontend/helpers/test_constants', }, collectCoverageFrom: ['<rootDir>/app/assets/javascripts/**/*.{js,vue}'], coverageDirectory: '<rootDir>/coverage-frontend/', @@ -62,3 +63,15 @@ module.exports = { IS_EE, }, }; + +const karmaTestFile = process.argv.find(arg => arg.includes('spec/javascripts/')); +if (karmaTestFile) { + console.error(` +Files in spec/javascripts/ and ee/spec/javascripts need to be run with Karma. +Please use the following command instead: + +yarn karma -f ${karmaTestFile} + +`); + process.exit(1); +} |