bootstrapWorker(worker)
This method registers a web worker with Mimic.
To use web workers with Mimic you must do 2 additional steps so Mimic can capture and mock your requests successfully.
1.In your web worker code, import the mimic worker script
import 'mimic/worker';
- In your application when loading the worker, use the bootstrapWorker method to let Mimic know that a worker is running.
import Mimic from 'mimic';
const worker = new Worker('worker.js');
Mimic.bootstrapWorker(worker);