vitest 0.34.2 → 0.34.4
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/browser.d.ts +3 -3
- package/dist/browser.js +1 -1
- package/dist/child.js +2 -2
- package/dist/{chunk-api-setup.cc5282f7.js → chunk-api-setup.d65b007d.js} +4 -4
- package/dist/{chunk-install-pkg.7e19b3a0.js → chunk-install-pkg.b2bdbadc.js} +4 -3
- package/dist/{chunk-integrations-globals.522ae1ae.js → chunk-integrations-globals.09bbbed7.js} +3 -3
- package/dist/cli.js +9 -8
- package/dist/config.cjs +3 -1
- package/dist/config.d.ts +3 -3
- package/dist/config.js +3 -1
- package/dist/coverage.d.ts +3 -3
- package/dist/entry-vm.js +3 -3
- package/dist/entry.js +6 -3
- package/dist/environments.d.ts +3 -3
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +3 -3
- package/dist/execute.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/loader.js +1 -1
- package/dist/node.d.ts +4 -4
- package/dist/node.js +4 -3
- package/dist/{types-63abf2e0.d.ts → reporters-cb94c88b.d.ts} +18 -15
- package/dist/reporters.d.ts +16 -0
- package/dist/reporters.js +16 -0
- package/dist/runners.d.ts +3 -3
- package/dist/runners.js +2 -2
- package/dist/{vendor-environments.37f266a9.js → vendor-environments.c9c96bf7.js} +16 -4
- package/dist/{vendor-execute.4fc8203a.js → vendor-execute.a63e187f.js} +8 -6
- package/dist/{vendor-index.087d1af7.js → vendor-index.29282562.js} +1 -1
- package/dist/{vendor-index.b5efbd68.js → vendor-index.e951dd92.js} +1 -1
- package/dist/{vendor-node.7b1bd3c5.js → vendor-node.b14cb9ad.js} +156 -2669
- package/dist/vendor-reporters.f6975b8d.js +2584 -0
- package/dist/{vendor-vi.f8055ff2.js → vendor-vi.befc11a6.js} +24 -23
- package/dist/vm.js +2 -2
- package/dist/worker.js +2 -2
- package/package.json +12 -8
- package/reporters.d.ts +1 -0
|
@@ -265,6 +265,15 @@ const LIVING_KEYS = [
|
|
|
265
265
|
"Headers",
|
|
266
266
|
"AbortController",
|
|
267
267
|
"AbortSignal",
|
|
268
|
+
"Uint8Array",
|
|
269
|
+
"Uint16Array",
|
|
270
|
+
"Uint32Array",
|
|
271
|
+
"Uint8ClampedArray",
|
|
272
|
+
"Int8Array",
|
|
273
|
+
"Int16Array",
|
|
274
|
+
"Int32Array",
|
|
275
|
+
"Float32Array",
|
|
276
|
+
"Float64Array",
|
|
268
277
|
"ArrayBuffer",
|
|
269
278
|
"DOMRectReadOnly",
|
|
270
279
|
"DOMRect",
|
|
@@ -464,7 +473,6 @@ var jsdom = {
|
|
|
464
473
|
);
|
|
465
474
|
const clearWindowErrors = catchWindowErrors(dom.window);
|
|
466
475
|
dom.window.Buffer = Buffer;
|
|
467
|
-
dom.window.Uint8Array = Uint8Array;
|
|
468
476
|
if (typeof structuredClone !== "undefined" && !dom.window.structuredClone)
|
|
469
477
|
dom.window.structuredClone = structuredClone;
|
|
470
478
|
return {
|
|
@@ -535,15 +543,14 @@ var happy = {
|
|
|
535
543
|
url: happyDOM.url || "http://localhost:3000"
|
|
536
544
|
});
|
|
537
545
|
win.Buffer = Buffer;
|
|
538
|
-
win.Uint8Array = Uint8Array;
|
|
539
546
|
if (typeof structuredClone !== "undefined" && !win.structuredClone)
|
|
540
547
|
win.structuredClone = structuredClone;
|
|
541
548
|
return {
|
|
542
549
|
getVmContext() {
|
|
543
550
|
return win;
|
|
544
551
|
},
|
|
545
|
-
teardown() {
|
|
546
|
-
win.happyDOM.cancelAsync();
|
|
552
|
+
async teardown() {
|
|
553
|
+
await win.happyDOM.cancelAsync();
|
|
547
554
|
}
|
|
548
555
|
};
|
|
549
556
|
},
|
|
@@ -551,6 +558,7 @@ var happy = {
|
|
|
551
558
|
const { Window, GlobalWindow } = await importModule("happy-dom");
|
|
552
559
|
const win = new (GlobalWindow || Window)({
|
|
553
560
|
...happyDOM,
|
|
561
|
+
console: console && global.console ? global.console : void 0,
|
|
554
562
|
url: happyDOM.url || "http://localhost:3000"
|
|
555
563
|
});
|
|
556
564
|
const { keys, originals } = populateGlobal(global, win, { bindFunctions: true });
|
|
@@ -590,6 +598,10 @@ var edge = {
|
|
|
590
598
|
extend: (context) => {
|
|
591
599
|
context.global = context;
|
|
592
600
|
context.Buffer = Buffer;
|
|
601
|
+
KEYS.forEach((key) => {
|
|
602
|
+
if (key in global)
|
|
603
|
+
context[key] = global[key];
|
|
604
|
+
});
|
|
593
605
|
return context;
|
|
594
606
|
}
|
|
595
607
|
});
|
|
@@ -317,11 +317,13 @@ ${c.green(`vi.mock("${mockpath}", async () => {
|
|
|
317
317
|
return exports;
|
|
318
318
|
}
|
|
319
319
|
if (typeof mock === "function" && !callstack.includes(mockPath) && !callstack.includes(url)) {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
320
|
+
try {
|
|
321
|
+
callstack.push(mockPath);
|
|
322
|
+
return await this.callFunctionMock(mockPath, mock);
|
|
323
|
+
} finally {
|
|
324
|
+
const indexMock = callstack.indexOf(mockPath);
|
|
325
|
+
callstack.splice(indexMock, 1);
|
|
326
|
+
}
|
|
325
327
|
}
|
|
326
328
|
if (typeof mock === "string" && !callstack.includes(mock))
|
|
327
329
|
return mock;
|
|
@@ -736,7 +738,7 @@ class ViteExecutor {
|
|
|
736
738
|
return cached;
|
|
737
739
|
const result = await this.options.transform(fileUrl, "web");
|
|
738
740
|
if (!result.code)
|
|
739
|
-
throw new Error(`[vitest] Failed to transform ${fileUrl}. Does the file
|
|
741
|
+
throw new Error(`[vitest] Failed to transform ${fileUrl}. Does the file exist?`);
|
|
740
742
|
return this.esm.createEsModule(fileUrl, result.code);
|
|
741
743
|
}
|
|
742
744
|
createViteClientModule() {
|
|
@@ -23,4 +23,4 @@ function removeUndefinedValues(obj) {
|
|
|
23
23
|
return obj;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export {
|
|
26
|
+
export { isWindows as a, isNode as b, relativePath as c, isRunningInBenchmark as i, removeUndefinedValues as r };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, suite, test } from '@vitest/runner';
|
|
2
|
-
import { e as bench, c as createExpect, d as globalExpect, v as vi, f as vitest } from './vendor-vi.
|
|
2
|
+
import { e as bench, c as createExpect, d as globalExpect, v as vi, f as vitest } from './vendor-vi.befc11a6.js';
|
|
3
3
|
import { i as isFirstRun, r as runOnce } from './vendor-run-once.3e5ef7d7.js';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
import { assert, should } from 'chai';
|