vitest 3.0.0 → 3.0.2
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.js +1 -1
- package/dist/chunks/{base.CUDzyU2J.js → base.gZAre3Yy.js} +3 -3
- package/dist/chunks/{cac.DZC9WjGM.js → cac.CHB7MTUk.js} +22 -22
- package/dist/chunks/{cli-api.CmJw5Cd_.js → cli-api.B7hOUwun.js} +164 -131
- package/dist/chunks/{console.CN7AiMGV.js → console.BxE0RUCr.js} +3 -3
- package/dist/chunks/{creator.DztqrnyH.js → creator.B8v1wNyQ.js} +3 -3
- package/dist/chunks/{execute.BMOaRArH.js → execute.4vt3NSmG.js} +3 -4
- package/dist/chunks/{globals.C5RQxaV3.js → globals.BSNBk3vE.js} +2 -2
- package/dist/chunks/{index.BQbxGbG9.js → index.Bf4FgyZN.js} +1 -1
- package/dist/chunks/{index.BJDntFik.js → index.Bh7wTRhh.js} +8 -8
- package/dist/chunks/{index.CUcwvygK.js → index.C2XSkjNu.js} +2 -2
- package/dist/chunks/{index.D9C26wCk.js → index.DfqWks-F.js} +1 -1
- package/dist/chunks/{index.TKSL1HjN.js → index.DyQPL4DO.js} +15 -15
- package/dist/chunks/{index.68735LiX.js → index.TH3f4LSA.js} +2 -2
- package/dist/chunks/{index.K90BXFOx.js → index.cYxyd29h.js} +12 -12
- package/dist/chunks/{inspector.DKLceBVD.js → inspector.CU9GlB9I.js} +1 -1
- package/dist/chunks/{resolveConfig.CSLLD33d.js → resolveConfig.DATSOo7x.js} +14 -14
- package/dist/chunks/{rpc.TVf73xOu.js → rpc.Bf456uf4.js} +1 -1
- package/dist/chunks/{runBaseTests.C0T_TQwH.js → runBaseTests.Ba8jtu6O.js} +8 -8
- package/dist/chunks/{setup-common.D0zLenuv.js → setup-common.jLbIuaww.js} +1 -1
- package/dist/chunks/{typechecker.BJMkWMXo.js → typechecker.ChNaIV36.js} +9 -9
- package/dist/chunks/{vi.Da_PT3Vw.js → vi.CjhMlMwf.js} +6 -6
- package/dist/chunks/{vm.DrFVeTXo.js → vm.CUw7ChSp.js} +5 -5
- package/dist/cli.js +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.js +1 -1
- package/dist/coverage.js +9 -9
- package/dist/environments.js +1 -1
- package/dist/execute.js +1 -1
- package/dist/index.js +2 -2
- package/dist/node.js +9 -9
- package/dist/reporters.js +2 -2
- package/dist/runners.js +4 -4
- package/dist/worker.js +5 -5
- package/dist/workers/forks.js +2 -2
- package/dist/workers/runVmTests.js +7 -7
- package/dist/workers/threads.js +2 -2
- package/dist/workers/vmForks.js +3 -3
- package/dist/workers/vmThreads.js +3 -3
- package/dist/workers.js +8 -8
- package/package.json +15 -15
|
@@ -121,7 +121,7 @@ function createCustomConsole(defaultState) {
|
|
|
121
121
|
Error.stackTraceLimit = limit;
|
|
122
122
|
buffer.push([data, trace]);
|
|
123
123
|
} else {
|
|
124
|
-
buffer.push([data,
|
|
124
|
+
buffer.push([data, undefined]);
|
|
125
125
|
}
|
|
126
126
|
schedule(id);
|
|
127
127
|
callback();
|
|
@@ -155,14 +155,14 @@ function createCustomConsole(defaultState) {
|
|
|
155
155
|
(line) => line.includes("at Console.trace")
|
|
156
156
|
);
|
|
157
157
|
if (isTrace) {
|
|
158
|
-
buffer.push([data,
|
|
158
|
+
buffer.push([data, undefined]);
|
|
159
159
|
} else {
|
|
160
160
|
const trace = stack?.slice(7).join("\n");
|
|
161
161
|
Error.stackTraceLimit = limit;
|
|
162
162
|
buffer.push([data, trace]);
|
|
163
163
|
}
|
|
164
164
|
} else {
|
|
165
|
-
buffer.push([data,
|
|
165
|
+
buffer.push([data, undefined]);
|
|
166
166
|
}
|
|
167
167
|
schedule(id);
|
|
168
168
|
callback();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync, writeFileSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { resolve, dirname, relative } from 'node:path';
|
|
4
|
-
import { detectPackageManager, installPackage } from './index.
|
|
5
|
-
import { p as prompt, f as findUp } from './index.
|
|
4
|
+
import { detectPackageManager, installPackage } from './index.DfqWks-F.js';
|
|
5
|
+
import { p as prompt, f as findUp } from './index.Bh7wTRhh.js';
|
|
6
6
|
import { x } from 'tinyexec';
|
|
7
7
|
import c from 'tinyrainbow';
|
|
8
8
|
import { c as configFiles } from './constants.fzPh7AOq.js';
|
|
@@ -373,7 +373,7 @@ async function installPackages(pkgManager, packages) {
|
|
|
373
373
|
log(c.cyan("\u25FC"), c.bold("Installing packages..."));
|
|
374
374
|
log(c.cyan("\u25FC"), packages.join(", "));
|
|
375
375
|
log();
|
|
376
|
-
await installPackage(packages, { dev: true, packageManager: pkgManager ??
|
|
376
|
+
await installPackage(packages, { dev: true, packageManager: pkgManager ?? undefined });
|
|
377
377
|
}
|
|
378
378
|
function readPkgJson(path) {
|
|
379
379
|
if (!existsSync(path)) {
|
|
@@ -22,7 +22,6 @@ const _UNC_REGEX = /^[/\\]{2}/;
|
|
|
22
22
|
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
23
23
|
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
24
24
|
const _EXTNAME_RE = /.(\.[^./]+)$/;
|
|
25
|
-
globalThis.process?.platform === "win32" ? ";" : ":";
|
|
26
25
|
const normalize = function(path) {
|
|
27
26
|
if (path.length === 0) {
|
|
28
27
|
return ".";
|
|
@@ -395,7 +394,7 @@ class VitestMocker {
|
|
|
395
394
|
}
|
|
396
395
|
} else if (!(prop in target)) {
|
|
397
396
|
if (this.filterPublicKeys.includes(prop)) {
|
|
398
|
-
return
|
|
397
|
+
return undefined;
|
|
399
398
|
}
|
|
400
399
|
throw this.createError(
|
|
401
400
|
`[vitest] No "${String(prop)}" export is defined on the "${mock.raw}" mock. Did you forget to return it from "vi.mock"?
|
|
@@ -538,7 +537,7 @@ If you need to partially mock a module, you can use "importOriginal" helper insi
|
|
|
538
537
|
action: "mock",
|
|
539
538
|
id,
|
|
540
539
|
importer,
|
|
541
|
-
factory: typeof factoryOrOptions === "function" ? factoryOrOptions :
|
|
540
|
+
factory: typeof factoryOrOptions === "function" ? factoryOrOptions : undefined,
|
|
542
541
|
type: mockType
|
|
543
542
|
});
|
|
544
543
|
}
|
|
@@ -764,7 +763,7 @@ class VitestExecutor extends ViteNodeRunner {
|
|
|
764
763
|
const { id: id2 } = error[Symbol.for("vitest.error.not_found.data")];
|
|
765
764
|
const path = this.mocker.normalizePath(id2);
|
|
766
765
|
const mock = this.mocker.getDependencyMock(path);
|
|
767
|
-
if (mock !==
|
|
766
|
+
if (mock !== undefined) {
|
|
768
767
|
return [id2, id2];
|
|
769
768
|
}
|
|
770
769
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as globalApis } from './constants.fzPh7AOq.js';
|
|
2
|
-
import { V as VitestIndex } from './index.
|
|
3
|
-
import './vi.
|
|
2
|
+
import { V as VitestIndex } from './index.Bf4FgyZN.js';
|
|
3
|
+
import './vi.CjhMlMwf.js';
|
|
4
4
|
import '@vitest/expect';
|
|
5
5
|
import '@vitest/runner';
|
|
6
6
|
import '@vitest/runner/utils';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createExpect, a as globalExpect, i as inject, v as vi, b as vitest } from './vi.
|
|
1
|
+
import { c as createExpect, a as globalExpect, i as inject, v as vi, b as vitest } from './vi.CjhMlMwf.js';
|
|
2
2
|
import { i as isFirstRun, a as runOnce } from './run-once.2ogXb3JV.js';
|
|
3
3
|
import { b as bench } from './benchmark.Cdu9hjj4.js';
|
|
4
4
|
import { expectTypeOf } from 'expect-type';
|
|
@@ -400,11 +400,11 @@ function requireKleur () {
|
|
|
400
400
|
rgx: new RegExp(`\\x1b\\[${close}m`, 'g')
|
|
401
401
|
};
|
|
402
402
|
return function (txt) {
|
|
403
|
-
if (this !==
|
|
403
|
+
if (this !== undefined && this.has !== undefined) {
|
|
404
404
|
this.has.includes(open) || (this.has.push(open),this.keys.push(blk));
|
|
405
|
-
return txt ===
|
|
405
|
+
return txt === undefined ? this : $.enabled ? run(this.keys, txt+'') : txt+'';
|
|
406
406
|
}
|
|
407
|
-
return txt ===
|
|
407
|
+
return txt === undefined ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';
|
|
408
408
|
};
|
|
409
409
|
}
|
|
410
410
|
|
|
@@ -816,7 +816,7 @@ function requirePrompt$1 () {
|
|
|
816
816
|
this.in = opts.stdin || process.stdin;
|
|
817
817
|
this.out = opts.stdout || process.stdout;
|
|
818
818
|
|
|
819
|
-
this.onRender = (opts.onRender || (() =>
|
|
819
|
+
this.onRender = (opts.onRender || (() => undefined)).bind(this);
|
|
820
820
|
|
|
821
821
|
const rl = readline.createInterface({
|
|
822
822
|
input: this.in,
|
|
@@ -2760,7 +2760,7 @@ function requireAutocomplete$1 () {
|
|
|
2760
2760
|
reset() {
|
|
2761
2761
|
this.input = '';
|
|
2762
2762
|
this.complete(() => {
|
|
2763
|
-
this.moveSelect(this.initial !==
|
|
2763
|
+
this.moveSelect(this.initial !== undefined ? this.initial : 0);
|
|
2764
2764
|
this.render();
|
|
2765
2765
|
});
|
|
2766
2766
|
this.render();
|
|
@@ -3973,7 +3973,7 @@ function requirePrompt () {
|
|
|
3973
3973
|
this.firstRender = true;
|
|
3974
3974
|
this.in = opts.stdin || process.stdin;
|
|
3975
3975
|
this.out = opts.stdout || process.stdout;
|
|
3976
|
-
this.onRender = (opts.onRender || (() =>
|
|
3976
|
+
this.onRender = (opts.onRender || (() => undefined)).bind(this);
|
|
3977
3977
|
const rl = readline.createInterface({ input:this.in, escapeCodeTimeout:50 });
|
|
3978
3978
|
readline.emitKeypressEvents(this.in, rl);
|
|
3979
3979
|
|
|
@@ -5735,7 +5735,7 @@ function requireAutocomplete () {
|
|
|
5735
5735
|
reset() {
|
|
5736
5736
|
this.input = '';
|
|
5737
5737
|
this.complete(() => {
|
|
5738
|
-
this.moveSelect(this.initial !==
|
|
5738
|
+
this.moveSelect(this.initial !== undefined ? this.initial : 0);
|
|
5739
5739
|
this.render();
|
|
5740
5740
|
});
|
|
5741
5741
|
this.render();
|
|
@@ -6502,7 +6502,7 @@ function requireLib () {
|
|
|
6502
6502
|
// update vars in case they changed
|
|
6503
6503
|
({ name, type } = question);
|
|
6504
6504
|
|
|
6505
|
-
if (prompts[type] ===
|
|
6505
|
+
if (prompts[type] === undefined) {
|
|
6506
6506
|
throw new Error(`prompt type (${type}) is not defined`);
|
|
6507
6507
|
}
|
|
6508
6508
|
|
|
@@ -2,8 +2,8 @@ import * as chai from 'chai';
|
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { t as takeCoverageInsideWorker } from './coverage.BWeNbfBa.js';
|
|
4
4
|
import { distDir } from '../path.js';
|
|
5
|
-
import { r as rpc } from './rpc.
|
|
6
|
-
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.
|
|
5
|
+
import { r as rpc } from './rpc.Bf456uf4.js';
|
|
6
|
+
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.jLbIuaww.js';
|
|
7
7
|
import { g as getWorkerState } from './utils.C8RiOc4B.js';
|
|
8
8
|
|
|
9
9
|
function setupChaiConfig(config) {
|
|
@@ -95,7 +95,7 @@ async function detectPackageManager(cwd = process.cwd()) {
|
|
|
95
95
|
cwd,
|
|
96
96
|
onUnknown(packageManager) {
|
|
97
97
|
console.warn("[@antfu/install-pkg] Unknown packageManager:", packageManager);
|
|
98
|
-
return
|
|
98
|
+
return undefined;
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
return result?.agent || null;
|
|
@@ -8,7 +8,7 @@ import { stripVTControlCharacters } from 'node:util';
|
|
|
8
8
|
import { isPrimitive, inspect, positionToOffset, lineSplitRE, toArray, notNullish } from '@vitest/utils';
|
|
9
9
|
import { performance as performance$1 } from 'node:perf_hooks';
|
|
10
10
|
import { parseErrorStacktrace, parseStacktrace } from '@vitest/utils/source-map';
|
|
11
|
-
import { T as TypeCheckError, g as getOutputFile, i as isTTY, h as hasFailedSnapshot } from './typechecker.
|
|
11
|
+
import { T as TypeCheckError, g as getOutputFile, i as isTTY, h as hasFailedSnapshot } from './typechecker.ChNaIV36.js';
|
|
12
12
|
import { mkdir, writeFile, readdir, stat, readFile } from 'node:fs/promises';
|
|
13
13
|
import { Console } from 'node:console';
|
|
14
14
|
import { Writable } from 'node:stream';
|
|
@@ -94,7 +94,7 @@ const parse = (text, reviver) => {
|
|
|
94
94
|
*/
|
|
95
95
|
const stringify = (value, replacer, space) => {
|
|
96
96
|
const $ = replacer && typeof replacer === object ?
|
|
97
|
-
(k, v) => (k === '' || -1 < replacer.indexOf(k) ? v :
|
|
97
|
+
(k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : undefined) :
|
|
98
98
|
(replacer || noop);
|
|
99
99
|
const known = new Map;
|
|
100
100
|
const input = [];
|
|
@@ -152,12 +152,12 @@ function printError(error, ctx, logger, options) {
|
|
|
152
152
|
parseErrorStacktrace(error2) {
|
|
153
153
|
if (options.task?.file.pool === "browser" && project.browser) {
|
|
154
154
|
return project.browser.parseErrorStacktrace(error2, {
|
|
155
|
-
ignoreStackEntries: options.fullStack ? [] :
|
|
155
|
+
ignoreStackEntries: options.fullStack ? [] : undefined
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
return parseErrorStacktrace(error2, {
|
|
159
159
|
frameFilter: project.config.onStackTrace,
|
|
160
|
-
ignoreStackEntries: options.fullStack ? [] :
|
|
160
|
+
ignoreStackEntries: options.fullStack ? [] : undefined
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
});
|
|
@@ -596,7 +596,7 @@ class BaseReporter {
|
|
|
596
596
|
watchFilters;
|
|
597
597
|
failedUnwatchedFiles = [];
|
|
598
598
|
isTTY;
|
|
599
|
-
ctx =
|
|
599
|
+
ctx = undefined;
|
|
600
600
|
renderSucceed = false;
|
|
601
601
|
verbose = false;
|
|
602
602
|
_filesInWatchMode = /* @__PURE__ */ new Map();
|
|
@@ -752,7 +752,7 @@ class BaseReporter {
|
|
|
752
752
|
const output = log.type === "stdout" ? this.ctx.logger.outputStream : this.ctx.logger.errorStream;
|
|
753
753
|
const write = (msg) => output.write(msg);
|
|
754
754
|
let headerText = "unknown test";
|
|
755
|
-
const task = log.taskId ? this.ctx.state.idMap.get(log.taskId) :
|
|
755
|
+
const task = log.taskId ? this.ctx.state.idMap.get(log.taskId) : undefined;
|
|
756
756
|
if (task) {
|
|
757
757
|
headerText = getFullName(task, c.dim(" > "));
|
|
758
758
|
} else if (log.taskId && log.taskId !== "__vitest__unknown_test__") {
|
|
@@ -872,7 +872,7 @@ class BaseReporter {
|
|
|
872
872
|
const failedTests = tests.filter((i) => i.result?.state === "fail");
|
|
873
873
|
const failedTotal = countTestErrors(failedSuites) + countTestErrors(failedTests);
|
|
874
874
|
let current = 1;
|
|
875
|
-
const errorDivider = () => this.error(`${c.red(c.dim(divider(`[${current++}/${failedTotal}]`,
|
|
875
|
+
const errorDivider = () => this.error(`${c.red(c.dim(divider(`[${current++}/${failedTotal}]`, undefined, 1)))}
|
|
876
876
|
`);
|
|
877
877
|
if (failedSuites.length) {
|
|
878
878
|
this.error(`
|
|
@@ -994,7 +994,7 @@ class WindowRenderer {
|
|
|
994
994
|
options;
|
|
995
995
|
streams;
|
|
996
996
|
buffer = [];
|
|
997
|
-
renderInterval =
|
|
997
|
+
renderInterval = undefined;
|
|
998
998
|
windowHeight = 0;
|
|
999
999
|
finished = false;
|
|
1000
1000
|
cleanups = [];
|
|
@@ -1133,7 +1133,7 @@ class SummaryReporter {
|
|
|
1133
1133
|
startTime = "";
|
|
1134
1134
|
currentTime = 0;
|
|
1135
1135
|
duration = 0;
|
|
1136
|
-
durationInterval =
|
|
1136
|
+
durationInterval = undefined;
|
|
1137
1137
|
onInit(ctx, options = {}) {
|
|
1138
1138
|
this.ctx = ctx;
|
|
1139
1139
|
this.options = {
|
|
@@ -1411,7 +1411,7 @@ class DefaultReporter extends BaseReporter {
|
|
|
1411
1411
|
}
|
|
1412
1412
|
onPathsCollected(paths = []) {
|
|
1413
1413
|
if (this.isTTY) {
|
|
1414
|
-
if (this.renderSucceed ===
|
|
1414
|
+
if (this.renderSucceed === undefined) {
|
|
1415
1415
|
this.renderSucceed = !!this.renderSucceed;
|
|
1416
1416
|
}
|
|
1417
1417
|
if (this.renderSucceed !== true) {
|
|
@@ -1537,7 +1537,7 @@ function formatTests(states) {
|
|
|
1537
1537
|
}
|
|
1538
1538
|
|
|
1539
1539
|
class GithubActionsReporter {
|
|
1540
|
-
ctx =
|
|
1540
|
+
ctx = undefined;
|
|
1541
1541
|
onInit(ctx) {
|
|
1542
1542
|
this.ctx = ctx;
|
|
1543
1543
|
}
|
|
@@ -1843,7 +1843,7 @@ class JUnitReporter {
|
|
|
1843
1843
|
const pairs = [];
|
|
1844
1844
|
for (const key in attrs) {
|
|
1845
1845
|
const attr = attrs[key];
|
|
1846
|
-
if (attr ===
|
|
1846
|
+
if (attr === undefined) {
|
|
1847
1847
|
continue;
|
|
1848
1848
|
}
|
|
1849
1849
|
pairs.push(`${key}="${escapeXML(attr)}"`);
|
|
@@ -1889,7 +1889,7 @@ class JUnitReporter {
|
|
|
1889
1889
|
"testcase",
|
|
1890
1890
|
{
|
|
1891
1891
|
classname,
|
|
1892
|
-
file: this.options.addFileAttribute ? filename :
|
|
1892
|
+
file: this.options.addFileAttribute ? filename : undefined,
|
|
1893
1893
|
name: task.name,
|
|
1894
1894
|
time: getDuration(task)
|
|
1895
1895
|
},
|
|
@@ -2018,7 +2018,7 @@ class JUnitReporter {
|
|
|
2018
2018
|
this.ctx.logger.log(`JUNIT report written to ${this.reportFile}`);
|
|
2019
2019
|
}
|
|
2020
2020
|
await this.fileFd?.close();
|
|
2021
|
-
this.fileFd =
|
|
2021
|
+
this.fileFd = undefined;
|
|
2022
2022
|
}
|
|
2023
2023
|
}
|
|
2024
2024
|
|
|
@@ -2352,7 +2352,7 @@ ${padding}`;
|
|
|
2352
2352
|
if (typeof data === "string") {
|
|
2353
2353
|
data = stripVTControlCharacters(data.trim().split("\n").filter(Boolean).pop());
|
|
2354
2354
|
if (data === "") {
|
|
2355
|
-
data =
|
|
2355
|
+
data = undefined;
|
|
2356
2356
|
}
|
|
2357
2357
|
}
|
|
2358
2358
|
if (data != null) {
|
|
@@ -28,7 +28,7 @@ function createBirpc(functions, options) {
|
|
|
28
28
|
if (method === "$close")
|
|
29
29
|
return close;
|
|
30
30
|
if (method === "then" && !eventNames.includes("then") && !("then" in functions))
|
|
31
|
-
return
|
|
31
|
+
return undefined;
|
|
32
32
|
const sendEvent = (...args) => {
|
|
33
33
|
post(serialize({ m: method, a: args, t: "q" }));
|
|
34
34
|
};
|
|
@@ -43,7 +43,7 @@ function createBirpc(functions, options) {
|
|
|
43
43
|
try {
|
|
44
44
|
await _promise;
|
|
45
45
|
} finally {
|
|
46
|
-
_promise =
|
|
46
|
+
_promise = undefined;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
return new Promise((resolve, reject) => {
|
|
@@ -373,7 +373,7 @@ var happy = {
|
|
|
373
373
|
const { Window } = await import('happy-dom');
|
|
374
374
|
let win = new Window({
|
|
375
375
|
...happyDOM,
|
|
376
|
-
console: console && globalThis.console ? globalThis.console :
|
|
376
|
+
console: console && globalThis.console ? globalThis.console : undefined,
|
|
377
377
|
url: happyDOM.url || "http://localhost:3000",
|
|
378
378
|
settings: {
|
|
379
379
|
...happyDOM.settings,
|
|
@@ -390,7 +390,7 @@ var happy = {
|
|
|
390
390
|
},
|
|
391
391
|
async teardown() {
|
|
392
392
|
await teardownWindow(win);
|
|
393
|
-
win =
|
|
393
|
+
win = undefined;
|
|
394
394
|
}
|
|
395
395
|
};
|
|
396
396
|
},
|
|
@@ -398,7 +398,7 @@ var happy = {
|
|
|
398
398
|
const { Window, GlobalWindow } = await import('happy-dom');
|
|
399
399
|
const win = new (GlobalWindow || Window)({
|
|
400
400
|
...happyDOM,
|
|
401
|
-
console: console && global.console ? global.console :
|
|
401
|
+
console: console && global.console ? global.console : undefined,
|
|
402
402
|
url: happyDOM.url || "http://localhost:3000",
|
|
403
403
|
settings: {
|
|
404
404
|
...happyDOM.settings,
|
|
@@ -466,11 +466,11 @@ var jsdom = {
|
|
|
466
466
|
} = jsdom;
|
|
467
467
|
let dom = new JSDOM(html, {
|
|
468
468
|
pretendToBeVisual,
|
|
469
|
-
resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) :
|
|
469
|
+
resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : undefined),
|
|
470
470
|
runScripts,
|
|
471
471
|
url,
|
|
472
|
-
virtualConsole: console && globalThis.console ? new VirtualConsole().sendTo(globalThis.console) :
|
|
473
|
-
cookieJar: cookieJar ? new CookieJar() :
|
|
472
|
+
virtualConsole: console && globalThis.console ? new VirtualConsole().sendTo(globalThis.console) : undefined,
|
|
473
|
+
cookieJar: cookieJar ? new CookieJar() : undefined,
|
|
474
474
|
includeNodeLocations,
|
|
475
475
|
contentType,
|
|
476
476
|
userAgent,
|
|
@@ -503,7 +503,7 @@ var jsdom = {
|
|
|
503
503
|
teardown() {
|
|
504
504
|
clearWindowErrors();
|
|
505
505
|
dom.window.close();
|
|
506
|
-
dom =
|
|
506
|
+
dom = undefined;
|
|
507
507
|
}
|
|
508
508
|
};
|
|
509
509
|
},
|
|
@@ -524,11 +524,11 @@ var jsdom = {
|
|
|
524
524
|
} = jsdom;
|
|
525
525
|
const dom = new JSDOM(html, {
|
|
526
526
|
pretendToBeVisual,
|
|
527
|
-
resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) :
|
|
527
|
+
resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : undefined),
|
|
528
528
|
runScripts,
|
|
529
529
|
url,
|
|
530
|
-
virtualConsole: console && global.console ? new VirtualConsole().sendTo(global.console) :
|
|
531
|
-
cookieJar: cookieJar ? new CookieJar() :
|
|
530
|
+
virtualConsole: console && global.console ? new VirtualConsole().sendTo(global.console) : undefined,
|
|
531
|
+
cookieJar: cookieJar ? new CookieJar() : undefined,
|
|
532
532
|
includeNodeLocations,
|
|
533
533
|
contentType,
|
|
534
534
|
userAgent,
|
|
@@ -633,8 +633,8 @@ var node = {
|
|
|
633
633
|
return context;
|
|
634
634
|
},
|
|
635
635
|
teardown() {
|
|
636
|
-
context =
|
|
637
|
-
global =
|
|
636
|
+
context = undefined;
|
|
637
|
+
global = undefined;
|
|
638
638
|
}
|
|
639
639
|
};
|
|
640
640
|
},
|
|
@@ -9,7 +9,7 @@ function setupInspect(ctx) {
|
|
|
9
9
|
const isEnabled = config.inspector.enabled;
|
|
10
10
|
if (isEnabled) {
|
|
11
11
|
inspector = __require("node:inspector");
|
|
12
|
-
const isOpen = inspector.url() !==
|
|
12
|
+
const isOpen = inspector.url() !== undefined;
|
|
13
13
|
if (!isOpen) {
|
|
14
14
|
inspector.open(
|
|
15
15
|
config.inspector.port,
|
|
@@ -13,7 +13,7 @@ import c from 'tinyrainbow';
|
|
|
13
13
|
import { e as extraInlineDeps, d as defaultPort, a as defaultBrowserPort, b as defaultInspectPort } from './constants.fzPh7AOq.js';
|
|
14
14
|
import * as nodeos from 'node:os';
|
|
15
15
|
import nodeos__default from 'node:os';
|
|
16
|
-
import { w as wrapSerializableConfig, a as Typechecker, b as isWindows } from './typechecker.
|
|
16
|
+
import { w as wrapSerializableConfig, a as Typechecker, b as isWindows } from './typechecker.ChNaIV36.js';
|
|
17
17
|
import { isCI, provider } from 'std-env';
|
|
18
18
|
import crypto from 'node:crypto';
|
|
19
19
|
import { isatty } from 'node:tty';
|
|
@@ -21,7 +21,7 @@ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
|
|
|
21
21
|
import require$$0 from 'util';
|
|
22
22
|
import require$$0$1 from 'path';
|
|
23
23
|
import EventEmitter from 'node:events';
|
|
24
|
-
import { c as createBirpc } from './index.
|
|
24
|
+
import { c as createBirpc } from './index.TH3f4LSA.js';
|
|
25
25
|
import Tinypool$1, { Tinypool } from 'tinypool';
|
|
26
26
|
import { MessageChannel } from 'node:worker_threads';
|
|
27
27
|
import { hasFailed } from '@vitest/runner/utils';
|
|
@@ -2282,7 +2282,7 @@ function resolveModule(name, options = {}) {
|
|
|
2282
2282
|
try {
|
|
2283
2283
|
return _resolve(name, options);
|
|
2284
2284
|
} catch {
|
|
2285
|
-
return
|
|
2285
|
+
return undefined;
|
|
2286
2286
|
}
|
|
2287
2287
|
}
|
|
2288
2288
|
function isPackageExists(name, options = {}) {
|
|
@@ -2642,7 +2642,7 @@ function requireToRegexRange () {
|
|
|
2642
2642
|
throw new TypeError('toRegexRange: expected the first argument to be a number');
|
|
2643
2643
|
}
|
|
2644
2644
|
|
|
2645
|
-
if (max ===
|
|
2645
|
+
if (max === undefined || min === max) {
|
|
2646
2646
|
return String(min);
|
|
2647
2647
|
}
|
|
2648
2648
|
|
|
@@ -5485,7 +5485,7 @@ function requireParse () {
|
|
|
5485
5485
|
}
|
|
5486
5486
|
|
|
5487
5487
|
if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
|
|
5488
|
-
const end = rest[1] !==
|
|
5488
|
+
const end = rest[1] !== undefined ? '|$' : '';
|
|
5489
5489
|
|
|
5490
5490
|
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
5491
5491
|
prior.output = `(?:${prior.output}`;
|
|
@@ -6441,7 +6441,7 @@ function requireMicromatch () {
|
|
|
6441
6441
|
let match = regex.exec(posix ? utils.toPosixSlashes(input) : input);
|
|
6442
6442
|
|
|
6443
6443
|
if (match) {
|
|
6444
|
-
return match.slice(1).map(v => v ===
|
|
6444
|
+
return match.slice(1).map(v => v === undefined ? '' : v);
|
|
6445
6445
|
}
|
|
6446
6446
|
};
|
|
6447
6447
|
|
|
@@ -6558,7 +6558,7 @@ function getTransformMode(patterns, filename) {
|
|
|
6558
6558
|
if (patterns.ssr && mm.isMatch(filename, patterns.ssr)) {
|
|
6559
6559
|
return "ssr";
|
|
6560
6560
|
}
|
|
6561
|
-
return
|
|
6561
|
+
return undefined;
|
|
6562
6562
|
}
|
|
6563
6563
|
async function groupFilesByEnv(files) {
|
|
6564
6564
|
const filesWithEnv = await Promise.all(
|
|
@@ -7253,7 +7253,7 @@ function getWorkerMemoryLimit(config) {
|
|
|
7253
7253
|
return 1 / (config.poolOptions?.vmThreads?.maxThreads ?? getDefaultThreadsCount(config));
|
|
7254
7254
|
}
|
|
7255
7255
|
function stringToBytes(input, percentageReference) {
|
|
7256
|
-
if (input === null || input ===
|
|
7256
|
+
if (input === null || input === undefined) {
|
|
7257
7257
|
return input;
|
|
7258
7258
|
}
|
|
7259
7259
|
if (typeof input === "string") {
|
|
@@ -7357,7 +7357,7 @@ function createVmForksPool(ctx, { execArgv, env }) {
|
|
|
7357
7357
|
],
|
|
7358
7358
|
terminateTimeout: ctx.config.teardownTimeout,
|
|
7359
7359
|
concurrentTasksPerWorker: 1,
|
|
7360
|
-
maxMemoryLimitBeforeRecycle: getMemoryLimit$1(ctx.config) ||
|
|
7360
|
+
maxMemoryLimitBeforeRecycle: getMemoryLimit$1(ctx.config) || undefined
|
|
7361
7361
|
};
|
|
7362
7362
|
if (poolOptions.singleFork || !ctx.config.fileParallelism) {
|
|
7363
7363
|
options.maxThreads = 1;
|
|
@@ -7496,7 +7496,7 @@ function createVmThreadsPool(ctx, { execArgv, env }) {
|
|
|
7496
7496
|
],
|
|
7497
7497
|
terminateTimeout: ctx.config.teardownTimeout,
|
|
7498
7498
|
concurrentTasksPerWorker: 1,
|
|
7499
|
-
maxMemoryLimitBeforeRecycle: getMemoryLimit(ctx.config) ||
|
|
7499
|
+
maxMemoryLimitBeforeRecycle: getMemoryLimit(ctx.config) || undefined
|
|
7500
7500
|
};
|
|
7501
7501
|
if (poolOptions.singleThread || !ctx.config.fileParallelism) {
|
|
7502
7502
|
options.maxThreads = 1;
|
|
@@ -7813,7 +7813,7 @@ function resolvePath(path, root) {
|
|
|
7813
7813
|
);
|
|
7814
7814
|
}
|
|
7815
7815
|
function parseInspector(inspect) {
|
|
7816
|
-
if (typeof inspect === "boolean" || inspect ===
|
|
7816
|
+
if (typeof inspect === "boolean" || inspect === undefined) {
|
|
7817
7817
|
return {};
|
|
7818
7818
|
}
|
|
7819
7819
|
if (typeof inspect === "number") {
|
|
@@ -8069,7 +8069,7 @@ ${JSON.stringify({ browser: { provider: "playwright", instances: [{ browser: "ch
|
|
|
8069
8069
|
resolved.server.deps ??= {};
|
|
8070
8070
|
const deprecatedDepsOptions = ["inline", "external", "fallbackCJS"];
|
|
8071
8071
|
deprecatedDepsOptions.forEach((option) => {
|
|
8072
|
-
if (resolved.deps[option] ===
|
|
8072
|
+
if (resolved.deps[option] === undefined) {
|
|
8073
8073
|
return;
|
|
8074
8074
|
}
|
|
8075
8075
|
if (option === "fallbackCJS") {
|
|
@@ -8090,7 +8090,7 @@ ${JSON.stringify({ browser: { provider: "playwright", instances: [{ browser: "ch
|
|
|
8090
8090
|
)
|
|
8091
8091
|
);
|
|
8092
8092
|
}
|
|
8093
|
-
if (resolved.server.deps[option] ===
|
|
8093
|
+
if (resolved.server.deps[option] === undefined) {
|
|
8094
8094
|
resolved.server.deps[option] = resolved.deps[option];
|
|
8095
8095
|
}
|
|
8096
8096
|
});
|
|
@@ -8121,7 +8121,7 @@ ${JSON.stringify({ browser: { provider: "playwright", instances: [{ browser: "ch
|
|
|
8121
8121
|
resolved.root
|
|
8122
8122
|
);
|
|
8123
8123
|
}
|
|
8124
|
-
resolved.testNamePattern = resolved.testNamePattern ? resolved.testNamePattern instanceof RegExp ? resolved.testNamePattern : new RegExp(resolved.testNamePattern) :
|
|
8124
|
+
resolved.testNamePattern = resolved.testNamePattern ? resolved.testNamePattern instanceof RegExp ? resolved.testNamePattern : new RegExp(resolved.testNamePattern) : undefined;
|
|
8125
8125
|
if (resolved.snapshotFormat && "plugins" in resolved.snapshotFormat) {
|
|
8126
8126
|
resolved.snapshotFormat.plugins = [];
|
|
8127
8127
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
2
|
import { startTests, collectTests } from '@vitest/runner';
|
|
3
|
-
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.
|
|
3
|
+
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.C2XSkjNu.js';
|
|
4
4
|
import { s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './coverage.BWeNbfBa.js';
|
|
5
|
-
import { a as globalExpect, v as vi } from './vi.
|
|
6
|
-
import { c as closeInspector } from './inspector.
|
|
5
|
+
import { a as globalExpect, v as vi } from './vi.CjhMlMwf.js';
|
|
6
|
+
import { c as closeInspector } from './inspector.CU9GlB9I.js';
|
|
7
7
|
import { createRequire } from 'node:module';
|
|
8
8
|
import timers from 'node:timers';
|
|
9
9
|
import timersPromises from 'node:timers/promises';
|
|
@@ -11,15 +11,15 @@ import util from 'node:util';
|
|
|
11
11
|
import { getSafeTimers } from '@vitest/utils';
|
|
12
12
|
import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
|
|
13
13
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
14
|
-
import { V as VitestIndex } from './index.
|
|
15
|
-
import { s as setupCommonEnv } from './setup-common.
|
|
14
|
+
import { V as VitestIndex } from './index.Bf4FgyZN.js';
|
|
15
|
+
import { s as setupCommonEnv } from './setup-common.jLbIuaww.js';
|
|
16
16
|
import { g as getWorkerState, r as resetModules } from './utils.C8RiOc4B.js';
|
|
17
17
|
import 'chai';
|
|
18
18
|
import 'node:path';
|
|
19
19
|
import '../path.js';
|
|
20
20
|
import 'node:url';
|
|
21
|
-
import './rpc.
|
|
22
|
-
import './index.
|
|
21
|
+
import './rpc.Bf456uf4.js';
|
|
22
|
+
import './index.TH3f4LSA.js';
|
|
23
23
|
import '@vitest/expect';
|
|
24
24
|
import '@vitest/runner/utils';
|
|
25
25
|
import './_commonjsHelpers.BFTU3MAI.js';
|
|
@@ -79,7 +79,7 @@ function resolveAsset(mod, url) {
|
|
|
79
79
|
mod.exports = url;
|
|
80
80
|
}
|
|
81
81
|
async function setupConsoleLogSpy() {
|
|
82
|
-
const { createCustomConsole } = await import('./console.
|
|
82
|
+
const { createCustomConsole } = await import('./console.BxE0RUCr.js');
|
|
83
83
|
globalThis.console = createCustomConsole();
|
|
84
84
|
}
|
|
85
85
|
async function withEnv({ environment }, options, fn) {
|
|
@@ -13,7 +13,7 @@ async function setupCommonEnv(config) {
|
|
|
13
13
|
globalSetup = true;
|
|
14
14
|
setSafeTimers();
|
|
15
15
|
if (config.globals) {
|
|
16
|
-
(await import('./globals.
|
|
16
|
+
(await import('./globals.BSNBk3vE.js')).registerApiGlobally();
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
function setupDefines(defines) {
|