From 15894ed8bd3c6a653c4a8d2f2b1454939b26f60e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 23 Apr 2020 16:04:20 +0100 Subject: [PATCH] mock out wasm imports in jest Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- __mocks__/wasmMock.js | 1 + package.json | 1 + 2 files changed, 2 insertions(+) create mode 100644 __mocks__/wasmMock.js diff --git a/__mocks__/wasmMock.js b/__mocks__/wasmMock.js new file mode 100644 index 000000000..9b5d9b347 --- /dev/null +++ b/__mocks__/wasmMock.js @@ -0,0 +1 @@ +module.exports = "css-file-stub"; diff --git a/package.json b/package.json index 76576363f..f427e5b45 100644 --- a/package.json +++ b/package.json @@ -215,6 +215,7 @@ "/node_modules/matrix-react-sdk/test/setupTests.js" ], "moduleNameMapper": { + "\\.wasm$": "/__mocks__/wasmMock.js", "\\.(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",