diff --git a/package.json b/package.json index 789d7361a..2cdf69853 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,9 @@ "transformIgnorePatterns": [ "node_modules/(?!(roughjs|points-on-curve|path-data-parser|points-on-path|browser-fs-access)/)" ], + "moduleNameMapper": { + "^worker-loader!.+": "/src/__mocks__/worker-mock.js" + }, "resetMocks": false }, "name": "excalidraw", diff --git a/src/__mocks__/worker-mock.js b/src/__mocks__/worker-mock.js new file mode 100644 index 000000000..428f1f8e3 --- /dev/null +++ b/src/__mocks__/worker-mock.js @@ -0,0 +1,4 @@ +module.exports = class { + postMessage() {} + terminate() {} +};