Skip to content

Commit

Permalink
Use EUI test environment build with Jest (#55877)
Browse files Browse the repository at this point in the history
* wip

* dir name

* src snapshot changes

* x-pack snapshots

* svg element lookups

* snapshot updates

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
thompsongl and elasticmachine authored Mar 10, 2020
1 parent c874df1 commit 4e52dee
Show file tree
Hide file tree
Showing 88 changed files with 1,315 additions and 3,711 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@
},
"devDependencies": {
"@babel/parser": "^7.5.5",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/types": "^7.5.5",
"@elastic/elasticsearch": "^7.4.0",
"@elastic/eslint-config-kibana": "0.15.0",
Expand Down Expand Up @@ -390,7 +389,6 @@
"axe-core": "^3.4.1",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-plugin-dynamic-import-node": "^2.3.0",
"babel-plugin-istanbul": "^5.2.0",
"backport": "4.9.0",
"chai": "3.5.0",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/dev/jest/babel_transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,4 @@ module.exports = babelJest.createTransformer({
},
],
],
plugins: [
// enables jest to parse and execute dynamic import() calls
'@babel/plugin-syntax-dynamic-import',
'dynamic-import-node',
],
});
6 changes: 4 additions & 2 deletions src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export default {
'!src/legacy/ui/public/{agg_types,vis}/**/*.d.ts',
],
moduleNameMapper: {
'@elastic/eui$': '<rootDir>/node_modules/@elastic/eui/test-env',
'@elastic/eui/lib/(.*)?': '<rootDir>/node_modules/@elastic/eui/test-env/$1',
'^src/plugins/(.*)': '<rootDir>/src/plugins/$1',
'^plugins/([^/.]*)(.*)': '<rootDir>/src/legacy/core_plugins/$1/public$2',
'^ui/(.*)': '<rootDir>/src/legacy/ui/public/$1',
Expand Down Expand Up @@ -88,9 +90,9 @@ export default {
'^.+\\.html?$': 'jest-raw-loader',
},
transformIgnorePatterns: [
// ignore all node_modules except @elastic/eui and monaco-editor which both require babel transforms to handle dynamic import()
// ignore all node_modules except monaco-editor which requires babel transforms to handle dynamic import()
// since ESM modules are not natively supported in Jest yet (https://github.com/facebook/jest/issues/4842)
'[/\\\\]node_modules(?![\\/\\\\]@elastic[\\/\\\\]eui)(?![\\/\\\\]monaco-editor)[/\\\\].+\\.js$',
'[/\\\\]node_modules(?![\\/\\\\]monaco-editor)[/\\\\].+\\.js$',
'packages/kbn-pm/dist/index.js',
],
snapshotSerializers: [
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4e52dee

Please sign in to comment.