diff --git a/src/jest/config.json b/src/jest/config.json index bd57190a46591..f5b7c1260fc33 100644 --- a/src/jest/config.json +++ b/src/jest/config.json @@ -13,7 +13,9 @@ "!ui_framework/components/**/*/index.js" ], "moduleNameMapper": { - "^ui_framework/components": "/ui_framework/components" + "^ui_framework/components": "/ui_framework/components", + "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/src/jest/file_mock.js", + "\\.(css|less|scss)$": "/src/jest/style_mock.js" }, "coverageDirectory": "/target/jest-coverage", "coverageReporters": [ @@ -38,4 +40,4 @@ "snapshotSerializers": [ "/node_modules/enzyme-to-json/serializer" ] -} \ No newline at end of file +} diff --git a/src/jest/file_mock.js b/src/jest/file_mock.js new file mode 100644 index 0000000000000..86059f3629249 --- /dev/null +++ b/src/jest/file_mock.js @@ -0,0 +1 @@ +module.exports = 'test-file-stub'; diff --git a/src/jest/style_mock.js b/src/jest/style_mock.js new file mode 100644 index 0000000000000..f053ebf7976e3 --- /dev/null +++ b/src/jest/style_mock.js @@ -0,0 +1 @@ +module.exports = {};