diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 14:22:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 14:22:11 +0000 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /jest.config.base.js | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) | |
download | gitlab-ce-0c872e02b2c822e3397515ec324051ff540f0cd5.tar.gz |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'jest.config.base.js')
-rw-r--r-- | jest.config.base.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/jest.config.base.js b/jest.config.base.js index 30e11122f81..05967b51b88 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -1,6 +1,7 @@ const IS_EE = require('./config/helpers/is_ee_env'); const isESLint = require('./config/helpers/is_eslint'); const IS_JH = require('./config/helpers/is_jh_env'); +const { TEST_HOST } = require('./spec/frontend/__helpers__/test_constants'); module.exports = (path, options = {}) => { const { @@ -25,7 +26,7 @@ module.exports = (path, options = {}) => { ]); } - const glob = `${path}/**/*_spec.js`; + const glob = `${path}/**/*@([._])spec.js`; let testMatch = [`<rootDir>/${glob}`]; if (IS_EE) { testMatch.push(`<rootDir>/ee/${glob}`); @@ -43,6 +44,8 @@ module.exports = (path, options = {}) => { const TEST_FIXTURES_PATTERN = 'test_fixtures(/.*)$'; const moduleNameMapper = { + '^~(/.*)\\?(worker|raw)$': '<rootDir>/app/assets/javascripts$1', + '^(.*)\\?(worker|raw)$': '$1', '^~(/.*)$': '<rootDir>/app/assets/javascripts$1', '^ee_component(/.*)$': '<rootDir>/app/assets/javascripts/vue_shared/components/empty_component.js', @@ -63,6 +66,7 @@ module.exports = (path, options = {}) => { '^jest/(.*)$': '<rootDir>/spec/frontend/$1', '^ee_else_ce_jest/(.*)$': '<rootDir>/spec/frontend/$1', '^jquery$': '<rootDir>/node_modules/jquery/dist/jquery.slim.js', + '^@sentry/browser$': '<rootDir>/app/assets/javascripts/sentry/sentry_browser_wrapper.js', ...extModuleNameMapper, }; @@ -153,6 +157,7 @@ module.exports = (path, options = {}) => { 'dateformat', 'lowlight', 'vscode-languageserver-types', + 'yaml', ...gfmParserDependencies, ]; @@ -183,11 +188,16 @@ module.exports = (path, options = {}) => { '^.+\\.(md|zip|png|yml|yaml)$': './spec/frontend/__helpers__/raw_transformer.js', }, transformIgnorePatterns: [`node_modules/(?!(${transformIgnoreNodeModules.join('|')}))`], - timers: 'legacy', + fakeTimers: { + enableGlobally: true, + doNotFake: ['nextTick', 'setImmediate'], + legacyFakeTimers: true, + }, testEnvironment: '<rootDir>/spec/frontend/environment.js', testEnvironmentOptions: { IS_EE, IS_JH, + url: TEST_HOST, }, testRunner: 'jest-jasmine2', }; |