Skip to content

Commit 474ea69

Browse files
authored
add react-monaco-editor to jest transformIgnorePatterns (#1276)
* add react-monaco-editor to jest transformIgnorePatterns Signed-off-by: Justin Kim <jungkm@amazon.com> * add a module name mapper for opensearch-dashboards/public Signed-off-by: Justin Kim <jungkm@amazon.com> --------- Signed-off-by: Justin Kim <jungkm@amazon.com>
1 parent f8c9338 commit 474ea69

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/jest.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ module.exports = {
1212
],
1313
setupFilesAfterEnv: [
1414
'<rootDir>/test/setup.jest.js',
15-
'<rootDir>../../src/dev/jest/setup/monaco_mock.js'
15+
'<rootDir>../../src/dev/jest/setup/monaco_mock.js',
1616
],
1717
modulePaths: ['node_modules', `../../node_modules`],
1818
coverageDirectory: './coverage',
1919
moduleNameMapper: {
2020
'\\.(css|less|scss)$': '<rootDir>/test/mocks/styleMock.js',
2121
'^ui/(.*)': '<rootDir>/../../src/legacy/ui/public/$1/',
22+
'^opensearch-dashboards/public$': '<rootDir>/../../src/core/public',
2223
'^!!raw-loader!.*': 'jest-raw-loader',
2324
},
2425
snapshotSerializers: ['../../node_modules/enzyme-to-json/serializer'],
@@ -54,6 +55,6 @@ module.exports = {
5455
transformIgnorePatterns: [
5556
// ignore all node_modules except d3-color which requires babel transforms to handle export statement
5657
// since ESM modules are not natively supported in Jest yet (https://github.com/facebook/jest/issues/4842)
57-
'[/\\\\]node_modules(?![\\/\\\\](monaco-editor|weak-lru-cache|ordered-binary|d3-color|axios))[/\\\\].+\\.js$',
58+
'[/\\\\]node_modules(?![\\/\\\\](monaco-editor|react-monaco-editor|weak-lru-cache|ordered-binary|d3-color|axios))[/\\\\].+\\.js$',
5859
],
5960
};

0 commit comments

Comments
 (0)