diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /jest.config.base.js | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'jest.config.base.js')
-rw-r--r-- | jest.config.base.js | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/jest.config.base.js b/jest.config.base.js index 0eab5caffb0..fb2f1084bea 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -106,10 +106,49 @@ module.exports = (path, options = {}) => { return '<rootDir>/coverage-frontend/'; }; + const gfmParserDependencies = [ + 'rehype-.*', + 'remark-.*', + 'hast*', + 'unist.*', + 'mdast-util-.*', + 'micromark.*', + 'vfile.*', + 'bail', + 'trough', + 'unified', + 'is-plain-obj', + 'decode-named-character-reference', + 'character-entities*', + 'property-information', + 'space-separated-tokens', + 'comma-separated-tokens', + 'web-namespaces', + 'zwitch', + 'html-void-elements', + 'ccount', + 'escape-string-regexp', + ]; + + const transformIgnoreNodeModules = [ + '@gitlab/ui', + '@gitlab/favicon-overlay', + 'bootstrap-vue', + 'three', + 'monaco-editor', + 'monaco-yaml', + 'fast-mersenne-twister', + 'prosemirror-markdown', + 'fault', + 'dateformat', + 'lowlight', + ...gfmParserDependencies, + ]; + return { clearMocks: true, testMatch, - moduleFileExtensions: ['js', 'json', 'vue', 'gql', 'graphql'], + moduleFileExtensions: ['js', 'json', 'vue', 'gql', 'graphql', 'yaml'], moduleNameMapper, collectCoverageFrom, coverageDirectory: coverageDirectory(), @@ -127,11 +166,10 @@ module.exports = (path, options = {}) => { '^.+_worker\\.js$': './spec/frontend/__helpers__/web_worker_transformer.js', '^.+\\.js$': 'babel-jest', '^.+\\.vue$': 'vue-jest', + '^.+\\.yml$': './spec/frontend/__helpers__/yaml_transformer.js', '^.+\\.(md|zip|png)$': 'jest-raw-loader', }, - transformIgnorePatterns: [ - 'node_modules/(?!(@gitlab/ui|@gitlab/favicon-overlay|bootstrap-vue|three|monaco-editor|monaco-yaml|fast-mersenne-twister|prosemirror-markdown|dateformat|lowlight|fault)/)', - ], + transformIgnorePatterns: [`node_modules/(?!(${transformIgnoreNodeModules.join('|')}))`], timers: 'fake', testEnvironment: '<rootDir>/spec/frontend/environment.js', testEnvironmentOptions: { |