From 6584ff29af1f57ccd79d67e005f0b50df89340c6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 22 Apr 2020 18:58:44 +0100 Subject: [PATCH] mock out scss imports for jest Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- __mocks__/cssMock.js | 1 + package.json | 1 + 2 files changed, 2 insertions(+) create mode 100644 __mocks__/cssMock.js diff --git a/__mocks__/cssMock.js b/__mocks__/cssMock.js new file mode 100644 index 00000000..9b5d9b34 --- /dev/null +++ b/__mocks__/cssMock.js @@ -0,0 +1 @@ +module.exports = "css-file-stub"; diff --git a/package.json b/package.json index 57d8513f..76576363 100644 --- a/package.json +++ b/package.json @@ -215,6 +215,7 @@ "/node_modules/matrix-react-sdk/test/setupTests.js" ], "moduleNameMapper": { + "\\.(css|scss)$": "/__mocks__/cssMock.js", "\\.(gif|png|svg|ttf|woff2)$": "/node_modules/matrix-react-sdk/__mocks__/imageMock.js", "\\$webapp/i18n/languages.json": "/node_modules/matrix-react-sdk/__mocks__/languages.json", "^browser-request$": "/node_modules/matrix-react-sdk/__mocks__/browser-request.js",