@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 +1 -1
- package/dist/pure.js +7 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
package/dist/pure.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { VitestExecutor } from 'vitest/
|
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
|
327
|
+
const state = getWorkerState();
|
328
|
+
const { config, rpc, mockMap, moduleCache } = state;
|
328
329
|
return {
|
329
330
|
fetchModule(id) {
|
330
|
-
return rpc.fetch(id,
|
331
|
+
return rpc.fetch(id, "web");
|
331
332
|
},
|
332
333
|
resolveId(id, importer) {
|
333
|
-
return rpc.resolveId(id, importer,
|
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.
|
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"
|