Skip to content

Testing Worker in Jest #14

Description

@astagi

Hi,

I'm trying to test my worker inside a Vue.js project. I load the worker inside my component using the worker-plugin (I also tried loading my Worker using Webpack worker-loader, unfortunately it doesn't provide a compatible interface and I had to mock the worker in that case)

const worker = new Worker('@/utils.worker.js', { type: 'module' });

But when I run my tests with Jest I get

console.error node_modules/jsdom-worker/dist/jsdom-worker.js:1
  TypeError: Only absolute URLs are supported
  ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions