developit / developit/jsdom-worker
Testing Worker in Jest
- Dominant language
- JavaScript
- Stars
- 291
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm trying to test my worker inside a Vue.js project. I load the worker inside my component using the [worker-plugin](https://github.com/GoogleChromeLabs/worker-plugin/) (I also tried loading my Worker using [Webpack worker-loader](https://webpack.js.org/loaders/worker-loader/), unfortunately it doesn't provide a compatible interface and I had to mock the worker in that case)
```js
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
...
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.