import Worker from 'workerjs';

const workerFiles = {
  'zee-worker': '../../res/zee-worker.js',
  'worker': '../../dist/worker.js',
};

const workerInstances = [];

export default class {
  constructor(file) {
    const worker = new Worker(workerFiles[file], true);
    workerInstances.push(worker);
    return worker;
  }
}

export function shutdownWorkers() {
  workerInstances.forEach(worker => worker.terminate());
  workerInstances.length = 0;
}

import Worker from 'workerjs';

const workerFiles = {
  // Paths are relative to workerjs' requireworker.js file
  'zee-worker': '../../res/zee-worker.js',
  'worker': '../../src/profile-logic/summary-worker/index.js',
};

const workerInstances = [];

export default class {
  constructor(file) {
    const worker = new Worker(workerFiles[file]);
    workerInstances.push(worker);
    return worker;
  }
}

export function shutdownWorkers() {
  workerInstances.forEach(worker => worker.terminate());
  workerInstances.length = 0;
}

Change the worker mock to adjust to Jason's workerjs changes
Change the worker mock to adjust to Jason's workerjs changes
