You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for anyone using ESM and creating worker separately in a js file (and using worker-loader to load the worker)
setting window.Worker = Worker is not going to work since here we are importing the worker as a module.
create __mocks__ folder and do a manual mock for your worker module, e.g:
for anyone using ESM and creating worker separately in a js file (and using
worker-loader
to load the worker)setting
window.Worker = Worker
is not going to work since here we are importing the worker as a module.create
__mocks__
folder and do a manual mock for your worker module, e.g:and in your
__mocks__/myworker.worker.js
file:and don't forget to call
jest.mock('myworker.worker.js')
spent a lot time struggling with this!
Originally posted by @kamaladenalhomsi in jestjs/jest#3449 (comment)
The text was updated successfully, but these errors were encountered: