@vitest/web-worker 2.1.0-beta.6 → 2.1.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/pure.js +6 -7
- package/package.json +2 -2
package/dist/pure.js
CHANGED
@@ -10,16 +10,16 @@ class InlineWorkerRunner extends VitestExecutor {
|
|
10
10
|
}
|
11
11
|
prepareContext(context) {
|
12
12
|
const ctx = super.prepareContext(context);
|
13
|
-
const importScripts = () => {
|
14
|
-
throw new Error(
|
15
|
-
"[vitest] `importScripts` is not supported in Vite workers. Please, consider using `import` instead."
|
16
|
-
);
|
17
|
-
};
|
18
13
|
return Object.assign(ctx, this.context, {
|
19
14
|
importScripts
|
20
15
|
});
|
21
16
|
}
|
22
17
|
}
|
18
|
+
function importScripts() {
|
19
|
+
throw new Error(
|
20
|
+
"[vitest] `importScripts` is not supported in Vite workers. Please, consider using `import` instead."
|
21
|
+
);
|
22
|
+
}
|
23
23
|
|
24
24
|
const VOID = -1;
|
25
25
|
const PRIMITIVE = 0;
|
@@ -334,7 +334,7 @@ function createMessageEvent(data, transferOrOptions, clone) {
|
|
334
334
|
}
|
335
335
|
function getRunnerOptions() {
|
336
336
|
const state = getWorkerState();
|
337
|
-
const { config, rpc,
|
337
|
+
const { config, rpc, moduleCache } = state;
|
338
338
|
return {
|
339
339
|
async fetchModule(id) {
|
340
340
|
const result = await rpc.fetch(id, "web");
|
@@ -348,7 +348,6 @@ function getRunnerOptions() {
|
|
348
348
|
return rpc.resolveId(id, importer, "web");
|
349
349
|
},
|
350
350
|
moduleCache,
|
351
|
-
mockMap,
|
352
351
|
interopDefault: config.deps.interopDefault ?? true,
|
353
352
|
moduleDirectories: config.deps.moduleDirectories,
|
354
353
|
root: config.root,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vitest/web-worker",
|
3
3
|
"type": "module",
|
4
|
-
"version": "2.1.0
|
4
|
+
"version": "2.1.0",
|
5
5
|
"description": "Web Worker support for testing in Vitest",
|
6
6
|
"license": "MIT",
|
7
7
|
"funding": "https://opencollective.com/vitest",
|
@@ -33,7 +33,7 @@
|
|
33
33
|
"dist"
|
34
34
|
],
|
35
35
|
"peerDependencies": {
|
36
|
-
"vitest": "2.1.0
|
36
|
+
"vitest": "2.1.0"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
39
|
"debug": "^4.3.6"
|