From 997abb7345c90c3bdf9670d7d61fbe44dedcb0f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Louv-Jansen?= Date: Mon, 7 Aug 2017 17:35:59 +0200 Subject: [PATCH] Mock out static files when running in Jest (#13315) --- src/jest/config.json | 3 ++- src/jest/file_mock.js | 1 + src/jest/style_mock.js | 1 + ui_framework/src/test/file_mock.js | 0 4 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/jest/file_mock.js create mode 100644 src/jest/style_mock.js delete mode 100644 ui_framework/src/test/file_mock.js diff --git a/src/jest/config.json b/src/jest/config.json index 5dfa5aeb748b6..fc460d24baf39 100644 --- a/src/jest/config.json +++ b/src/jest/config.json @@ -13,7 +13,8 @@ ], "moduleNameMapper": { "^ui_framework/components": "/ui_framework/components", - "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/ui_framework/src/test/file_mock.js" + "\\.(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": [ 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 = {}; diff --git a/ui_framework/src/test/file_mock.js b/ui_framework/src/test/file_mock.js deleted file mode 100644 index e69de29bb2d1d..0000000000000