@vitest/web-worker 0.33.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineWebWorkers } from './pure.js';
2
- import 'vitest/node';
2
+ import 'vitest/execute';
3
3
  import 'debug';
4
4
  import 'worker_threads';
5
5
 
package/dist/pure.js CHANGED
@@ -1,4 +1,4 @@
1
- import { VitestExecutor } from 'vitest/node';
1
+ import { VitestExecutor } from 'vitest/execute';
2
2
  import createDebug from 'debug';
3
3
  import { MessageChannel } from 'worker_threads';
4
4
 
@@ -324,20 +324,22 @@ function createMessageEvent(data, transferOrOptions, clone) {
324
324
  }
325
325
  }
326
326
  function getRunnerOptions() {
327
- const { config, ctx, rpc, mockMap, moduleCache } = getWorkerState();
327
+ const state = getWorkerState();
328
+ const { config, rpc, mockMap, moduleCache } = state;
328
329
  return {
329
330
  fetchModule(id) {
330
- return rpc.fetch(id, ctx.environment.name);
331
+ return rpc.fetch(id, "web");
331
332
  },
332
333
  resolveId(id, importer) {
333
- return rpc.resolveId(id, importer, ctx.environment.name);
334
+ return rpc.resolveId(id, importer, "web");
334
335
  },
335
336
  moduleCache,
336
337
  mockMap,
337
338
  interopDefault: config.deps.interopDefault ?? true,
338
339
  moduleDirectories: config.deps.moduleDirectories,
339
340
  root: config.root,
340
- base: config.base
341
+ base: config.base,
342
+ state
341
343
  };
342
344
  }
343
345
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/web-worker",
3
3
  "type": "module",
4
- "version": "0.33.0",
4
+ "version": "0.34.0",
5
5
  "description": "Web Worker support for testing in Vitest",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -35,7 +35,7 @@
35
35
  "*.d.ts"
36
36
  ],
37
37
  "peerDependencies": {
38
- "vitest": "*"
38
+ "vitest": ">=0.34.0"
39
39
  },
40
40
  "dependencies": {
41
41
  "debug": "^4.3.4"