vitest 0.12.5 → 0.12.6
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/{chunk-api-setup.62de6413.js → chunk-api-setup.02588d9f.js} +4 -4
- package/dist/{chunk-constants.153353ee.js → chunk-constants.7180775c.js} +1 -1
- package/dist/{chunk-defaults.374342ed.js → chunk-defaults.9e0c233e.js} +1 -1
- package/dist/{chunk-install-pkg.eb979c48.js → chunk-install-pkg.078f5345.js} +2 -2
- package/dist/chunk-integrations-globals.cf24723d.js +25 -0
- package/dist/{chunk-runtime-chain.eb563278.js → chunk-runtime-chain.5cae775c.js} +48 -15
- package/dist/{chunk-runtime-mocker.efd6b7ac.js → chunk-runtime-mocker.43db6608.js} +7 -6
- package/dist/{chunk-runtime-rpc.ef131645.js → chunk-runtime-rpc.ad208eea.js} +1 -1
- package/dist/{chunk-utils-global.03413604.js → chunk-utils-global.29e8a0a3.js} +3 -3
- package/dist/{chunk-utils-timers.a0f0fe66.js → chunk-utils-timers.64f2cbe8.js} +3 -2
- package/dist/{chunk-vite-node-externalize.8560ca65.js → chunk-vite-node-externalize.35ad761d.js} +34 -30
- package/dist/{chunk-vite-node-utils.1064f66b.js → chunk-vite-node-utils.26c328fa.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/entry.js +6 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -4
- package/dist/node.js +8 -8
- package/dist/{vendor-entry.5b810598.js → vendor-entry.5c1e6d94.js} +8 -7
- package/dist/{vendor-index.4e550a2c.js → vendor-index.3ff91c47.js} +1 -1
- package/dist/worker.js +5 -5
- package/package.json +3 -3
- package/dist/chunk-integrations-globals.4fea033a.js +0 -25
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import { b as createBirpc } from './chunk-vite-node-utils.
|
|
2
|
+
import { b as createBirpc } from './chunk-vite-node-utils.26c328fa.js';
|
|
3
3
|
import require$$0$1 from 'stream';
|
|
4
4
|
import require$$0 from 'zlib';
|
|
5
5
|
import require$$3 from 'net';
|
|
@@ -9,11 +9,11 @@ import require$$2 from 'events';
|
|
|
9
9
|
import require$$1 from 'https';
|
|
10
10
|
import require$$2$1 from 'http';
|
|
11
11
|
import url from 'url';
|
|
12
|
-
import { A as API_PATH } from './chunk-constants.
|
|
13
|
-
import { r as interpretSourcePos, b as parseStacktrace } from './chunk-utils-timers.
|
|
12
|
+
import { A as API_PATH } from './chunk-constants.7180775c.js';
|
|
13
|
+
import { r as interpretSourcePos, b as parseStacktrace } from './chunk-utils-timers.64f2cbe8.js';
|
|
14
14
|
import 'module';
|
|
15
15
|
import 'vm';
|
|
16
|
-
import './chunk-utils-global.
|
|
16
|
+
import './chunk-utils-global.29e8a0a3.js';
|
|
17
17
|
import 'tty';
|
|
18
18
|
import 'local-pkg';
|
|
19
19
|
import 'path';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from 'url';
|
|
2
|
-
import { k as resolve } from './chunk-utils-global.
|
|
2
|
+
import { k as resolve } from './chunk-utils-global.29e8a0a3.js';
|
|
3
3
|
|
|
4
4
|
const distDir = resolve(fileURLToPath(import.meta.url), "../../dist");
|
|
5
5
|
const defaultPort = 51204;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, promises } from 'fs';
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
3
|
import { pathToFileURL } from 'url';
|
|
4
|
-
import { t as toArray, k as resolve } from './chunk-utils-global.
|
|
4
|
+
import { t as toArray, k as resolve } from './chunk-utils-global.29e8a0a3.js';
|
|
5
5
|
|
|
6
6
|
const defaultInclude = ["**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"];
|
|
7
7
|
const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**"];
|
|
@@ -2,9 +2,9 @@ import path$2 from 'path';
|
|
|
2
2
|
import fs$2 from 'fs';
|
|
3
3
|
import require$$1 from 'util';
|
|
4
4
|
import childProcess$1 from 'child_process';
|
|
5
|
-
import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1, o as onetime$1 } from './vendor-index.
|
|
5
|
+
import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1, o as onetime$1 } from './vendor-index.3ff91c47.js';
|
|
6
6
|
import require$$0 from 'os';
|
|
7
|
-
import './chunk-utils-global.
|
|
7
|
+
import './chunk-utils-global.29e8a0a3.js';
|
|
8
8
|
import 'tty';
|
|
9
9
|
import 'local-pkg';
|
|
10
10
|
import 'assert';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { g as globalApis } from './chunk-constants.7180775c.js';
|
|
2
|
+
import { i as index } from './vendor-entry.5c1e6d94.js';
|
|
3
|
+
import 'url';
|
|
4
|
+
import './chunk-utils-global.29e8a0a3.js';
|
|
5
|
+
import 'tty';
|
|
6
|
+
import 'local-pkg';
|
|
7
|
+
import 'path';
|
|
8
|
+
import 'fs';
|
|
9
|
+
import './chunk-runtime-chain.5cae775c.js';
|
|
10
|
+
import 'chai';
|
|
11
|
+
import './chunk-runtime-rpc.ad208eea.js';
|
|
12
|
+
import './chunk-utils-timers.64f2cbe8.js';
|
|
13
|
+
import './chunk-integrations-spy.bee66426.js';
|
|
14
|
+
import 'tinyspy';
|
|
15
|
+
import 'util';
|
|
16
|
+
import './chunk-defaults.9e0c233e.js';
|
|
17
|
+
import 'module';
|
|
18
|
+
|
|
19
|
+
function registerApiGlobally() {
|
|
20
|
+
globalApis.forEach((api) => {
|
|
21
|
+
globalThis[api] = index[api];
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { registerApiGlobally };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import chai$1, { expect as expect$1, util } from 'chai';
|
|
2
|
-
import { c as commonjsGlobal, i as isObject, j as join, d as dirname, g as getCallLastIndex, s as slash, a as getWorkerState, b as getNames, e as assertTypes, p as picocolors, n as noop, t as toArray, r as resetModules } from './chunk-utils-global.
|
|
3
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
1
|
+
import chai$1, { expect as expect$1, AssertionError, util } from 'chai';
|
|
2
|
+
import { c as commonjsGlobal, i as isObject, j as join, d as dirname, g as getCallLastIndex, s as slash, a as getWorkerState, b as getNames, e as assertTypes, p as picocolors, n as noop, t as toArray, r as resetModules } from './chunk-utils-global.29e8a0a3.js';
|
|
3
|
+
import { r as rpc } from './chunk-runtime-rpc.ad208eea.js';
|
|
4
4
|
import fs, { promises } from 'fs';
|
|
5
|
-
import { p as plugins_1, f as format_1, g as getOriginalPos, a as posToNumber, n as numberToPos, l as lineSplitRE, b as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils, c as setTimeout, d as clearTimeout } from './chunk-utils-timers.
|
|
5
|
+
import { p as plugins_1, f as format_1, g as getOriginalPos, a as posToNumber, n as numberToPos, l as lineSplitRE, b as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils, c as setTimeout, d as clearTimeout } from './chunk-utils-timers.64f2cbe8.js';
|
|
6
6
|
import { i as isMockFunction, s as spyOn, f as fn, a as spies } from './chunk-integrations-spy.bee66426.js';
|
|
7
7
|
import require$$1, { format } from 'util';
|
|
8
8
|
|
|
@@ -1051,6 +1051,20 @@ const SnapshotPlugin = (chai, utils) => {
|
|
|
1051
1051
|
});
|
|
1052
1052
|
};
|
|
1053
1053
|
|
|
1054
|
+
function getRunningMode() {
|
|
1055
|
+
return process.env.VITEST_MODE === "WATCH" ? "watch" : "run";
|
|
1056
|
+
}
|
|
1057
|
+
function isWatchMode() {
|
|
1058
|
+
return getRunningMode() === "watch";
|
|
1059
|
+
}
|
|
1060
|
+
function toString(value) {
|
|
1061
|
+
try {
|
|
1062
|
+
return `${value}`;
|
|
1063
|
+
} catch (_error) {
|
|
1064
|
+
return "unknown";
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1054
1068
|
const MATCHERS_OBJECT = Symbol.for("matchers-object");
|
|
1055
1069
|
if (!Object.prototype.hasOwnProperty.call(global, MATCHERS_OBJECT)) {
|
|
1056
1070
|
const defaultState = {
|
|
@@ -1085,10 +1099,21 @@ const JestChaiExpect = (chai, utils) => {
|
|
|
1085
1099
|
return function(...args) {
|
|
1086
1100
|
const promise = utils.flag(this, "promise");
|
|
1087
1101
|
const object = utils.flag(this, "object");
|
|
1102
|
+
const isNot = utils.flag(this, "negate");
|
|
1088
1103
|
if (promise === "rejects") {
|
|
1089
1104
|
utils.flag(this, "object", () => {
|
|
1090
1105
|
throw object;
|
|
1091
1106
|
});
|
|
1107
|
+
} else if (promise === "resolves" && typeof object !== "function") {
|
|
1108
|
+
if (!isNot) {
|
|
1109
|
+
const message = utils.flag(this, "message") || "expected promise to throw an error, but it didn't";
|
|
1110
|
+
const error = {
|
|
1111
|
+
showDiff: false
|
|
1112
|
+
};
|
|
1113
|
+
throw new AssertionError(message, error, utils.flag(this, "ssfi"));
|
|
1114
|
+
} else {
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1092
1117
|
}
|
|
1093
1118
|
_super.apply(this, args);
|
|
1094
1119
|
};
|
|
@@ -1324,9 +1349,20 @@ Number of calls: ${picocolors.exports.bold(spy.mock.calls.length)}
|
|
|
1324
1349
|
return this.throws(expected);
|
|
1325
1350
|
const obj = this._obj;
|
|
1326
1351
|
const promise = utils.flag(this, "promise");
|
|
1352
|
+
const isNot = utils.flag(this, "negate");
|
|
1327
1353
|
let thrown = null;
|
|
1328
|
-
if (promise) {
|
|
1354
|
+
if (promise === "rejects") {
|
|
1329
1355
|
thrown = obj;
|
|
1356
|
+
} else if (promise === "resolves" && typeof obj !== "function") {
|
|
1357
|
+
if (!isNot) {
|
|
1358
|
+
const message = utils.flag(this, "message") || "expected promise to throw an error, but it didn't";
|
|
1359
|
+
const error = {
|
|
1360
|
+
showDiff: false
|
|
1361
|
+
};
|
|
1362
|
+
throw new AssertionError(message, error, utils.flag(this, "ssfi"));
|
|
1363
|
+
} else {
|
|
1364
|
+
return;
|
|
1365
|
+
}
|
|
1330
1366
|
} else {
|
|
1331
1367
|
try {
|
|
1332
1368
|
obj();
|
|
@@ -1390,6 +1426,8 @@ Number of calls: ${picocolors.exports.bold(spy.mock.calls.length)}
|
|
|
1390
1426
|
utils.flag(this, "promise", "resolves");
|
|
1391
1427
|
utils.flag(this, "error", new Error("resolves"));
|
|
1392
1428
|
const obj = utils.flag(this, "object");
|
|
1429
|
+
if (typeof (obj == null ? void 0 : obj.then) !== "function")
|
|
1430
|
+
throw new TypeError(`You must provide a Promise to expect() when using .resolves, not '${typeof obj}'.`);
|
|
1393
1431
|
const proxy = new Proxy(this, {
|
|
1394
1432
|
get: (target, key, receiver) => {
|
|
1395
1433
|
const result = Reflect.get(target, key, receiver);
|
|
@@ -1400,7 +1438,7 @@ Number of calls: ${picocolors.exports.bold(spy.mock.calls.length)}
|
|
|
1400
1438
|
utils.flag(this, "object", value);
|
|
1401
1439
|
return result.call(this, ...args);
|
|
1402
1440
|
}, (err) => {
|
|
1403
|
-
throw new Error(`promise rejected "${err}" instead of resolving`);
|
|
1441
|
+
throw new Error(`promise rejected "${toString(err)}" instead of resolving`);
|
|
1404
1442
|
});
|
|
1405
1443
|
};
|
|
1406
1444
|
}
|
|
@@ -1412,6 +1450,8 @@ Number of calls: ${picocolors.exports.bold(spy.mock.calls.length)}
|
|
|
1412
1450
|
utils.flag(this, "error", new Error("rejects"));
|
|
1413
1451
|
const obj = utils.flag(this, "object");
|
|
1414
1452
|
const wrapper = typeof obj === "function" ? obj() : obj;
|
|
1453
|
+
if (typeof (wrapper == null ? void 0 : wrapper.then) !== "function")
|
|
1454
|
+
throw new TypeError(`You must provide a Promise to expect() when using .rejects, not '${typeof wrapper}'.`);
|
|
1415
1455
|
const proxy = new Proxy(this, {
|
|
1416
1456
|
get: (target, key, receiver) => {
|
|
1417
1457
|
const result = Reflect.get(target, key, receiver);
|
|
@@ -1419,7 +1459,7 @@ Number of calls: ${picocolors.exports.bold(spy.mock.calls.length)}
|
|
|
1419
1459
|
return result instanceof chai.Assertion ? proxy : result;
|
|
1420
1460
|
return async (...args) => {
|
|
1421
1461
|
return wrapper.then((value) => {
|
|
1422
|
-
throw new Error(`promise resolved "${value}" instead of rejecting`);
|
|
1462
|
+
throw new Error(`promise resolved "${toString(value)}" instead of rejecting`);
|
|
1423
1463
|
}, (err) => {
|
|
1424
1464
|
utils.flag(this, "object", err);
|
|
1425
1465
|
return result.call(this, ...args);
|
|
@@ -4820,11 +4860,4 @@ class VitestUtils {
|
|
|
4820
4860
|
const vitest = new VitestUtils();
|
|
4821
4861
|
const vi = vitest;
|
|
4822
4862
|
|
|
4823
|
-
|
|
4824
|
-
return process.env.VITEST_MODE === "WATCH" ? "watch" : "run";
|
|
4825
|
-
}
|
|
4826
|
-
function isWatchMode() {
|
|
4827
|
-
return getRunningMode() === "watch";
|
|
4828
|
-
}
|
|
4829
|
-
|
|
4830
|
-
export { getState as A, RealDate as R, isFirstRun as a, beforeAll as b, afterAll as c, describe as d, beforeEach as e, afterEach as f, createExpect as g, expect as h, it as i, vi as j, getRunningMode as k, isWatchMode as l, resetRunOnceCounter as m, clearCollectorContext as n, defaultSuite as o, setHooks as p, getHooks as q, runOnce as r, suite as s, test as t, collectorContext as u, vitest as v, withCallback as w, getSnapshotClient as x, setState as y, getFn as z };
|
|
4863
|
+
export { getFn as A, getState as B, RealDate as R, isFirstRun as a, beforeAll as b, afterAll as c, describe as d, beforeEach as e, afterEach as f, createExpect as g, expect as h, it as i, vi as j, getRunningMode as k, isWatchMode as l, toString as m, resetRunOnceCounter as n, clearCollectorContext as o, defaultSuite as p, setHooks as q, runOnce as r, suite as s, test as t, getHooks as u, vitest as v, withCallback as w, collectorContext as x, getSnapshotClient as y, setState as z };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as normalizeRequestId, i as isNodeBuiltin, t as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.
|
|
1
|
+
import { n as normalizeRequestId, i as isNodeBuiltin, t as toFilePath, V as ViteNodeRunner } from './chunk-vite-node-utils.26c328fa.js';
|
|
2
2
|
import { normalizePath } from 'vite';
|
|
3
|
-
import { a as getWorkerState,
|
|
3
|
+
import { a as getWorkerState, F as isWindows, G as mergeSlashes, d as dirname, k as resolve, h as basename, H as getType, I as getAllProperties, s as slash } from './chunk-utils-global.29e8a0a3.js';
|
|
4
4
|
import { existsSync, readdirSync } from 'fs';
|
|
5
|
-
import { d as distDir } from './chunk-constants.
|
|
5
|
+
import { d as distDir } from './chunk-constants.7180775c.js';
|
|
6
6
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -50,9 +50,10 @@ const _VitestMocker = class {
|
|
|
50
50
|
}
|
|
51
51
|
async resolvePath(id, importer) {
|
|
52
52
|
const path = await this.options.resolveId(id, importer);
|
|
53
|
+
const external = path == null || path.id.includes("/node_modules/") ? id : null;
|
|
53
54
|
return {
|
|
54
55
|
path: normalizeRequestId((path == null ? void 0 : path.id) || id),
|
|
55
|
-
external
|
|
56
|
+
external
|
|
56
57
|
};
|
|
57
58
|
}
|
|
58
59
|
async resolveMocks() {
|
|
@@ -91,13 +92,13 @@ const _VitestMocker = class {
|
|
|
91
92
|
}
|
|
92
93
|
resolveMockPath(mockPath, external) {
|
|
93
94
|
const path = normalizeRequestId(external || mockPath);
|
|
94
|
-
if (external || isNodeBuiltin(mockPath)) {
|
|
95
|
+
if (external || isNodeBuiltin(mockPath) || !existsSync(mockPath)) {
|
|
95
96
|
const mockDirname = dirname(path);
|
|
96
|
-
const baseFilename = basename(path);
|
|
97
97
|
const mockFolder = resolve(this.root, "__mocks__", mockDirname);
|
|
98
98
|
if (!existsSync(mockFolder))
|
|
99
99
|
return null;
|
|
100
100
|
const files = readdirSync(mockFolder);
|
|
101
|
+
const baseFilename = basename(path);
|
|
101
102
|
for (const file of files) {
|
|
102
103
|
const [basename2] = file.split(".");
|
|
103
104
|
if (basename2 === baseFilename)
|
|
@@ -391,7 +391,7 @@ function getNames(task) {
|
|
|
391
391
|
return names;
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
-
const isNode = typeof process !== "undefined" && typeof process.
|
|
394
|
+
const isNode = typeof process !== "undefined" && typeof process.platform !== "undefined";
|
|
395
395
|
const isWindows = isNode && process.platform === "win32";
|
|
396
396
|
function partitionSuiteChildren(suite) {
|
|
397
397
|
let tasksGroup = [];
|
|
@@ -439,7 +439,7 @@ async function ensurePackageInstalled(dependency, promptInstall = !process.env.C
|
|
|
439
439
|
message: picocolors.exports.reset(`Do you want to install ${picocolors.exports.green(dependency)}?`)
|
|
440
440
|
});
|
|
441
441
|
if (install) {
|
|
442
|
-
await (await import('./chunk-install-pkg.
|
|
442
|
+
await (await import('./chunk-install-pkg.078f5345.js')).installPackage(dependency, { dev: true });
|
|
443
443
|
process.stderr.write(picocolors.exports.yellow(`
|
|
444
444
|
Package ${dependency} installed, re-run the command to start.
|
|
445
445
|
`));
|
|
@@ -477,4 +477,4 @@ function getCallLastIndex(code) {
|
|
|
477
477
|
return null;
|
|
478
478
|
}
|
|
479
479
|
|
|
480
|
-
export {
|
|
480
|
+
export { toNamespacedPath as A, ensurePackageInstalled as B, stdout as C, extname as D, getDefaultExportFromCjs as E, isWindows as F, mergeSlashes as G, getType as H, getAllProperties as I, clone as J, partitionSuiteChildren as K, hasTests as L, getWorkerState as a, getNames as b, commonjsGlobal as c, dirname as d, assertTypes as e, notNullish as f, getCallLastIndex as g, basename as h, isObject as i, join as j, resolve as k, isAbsolute as l, relative as m, noop as n, isNode as o, picocolors as p, getTests as q, resetModules as r, slash as s, toArray as t, getFullName as u, hasFailed as v, hasFailedSnapshot as w, getSuites as x, normalize as y, deepMerge as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as slash, f as notNullish, p as picocolors } from './chunk-utils-global.
|
|
1
|
+
import { s as slash, f as notNullish, p as picocolors } from './chunk-utils-global.29e8a0a3.js';
|
|
2
2
|
|
|
3
3
|
const setTimeout$1 = globalThis.setTimeout;
|
|
4
4
|
const setInterval = globalThis.setInterval;
|
|
@@ -7238,7 +7238,8 @@ function cliTruncate(text, columns, options) {
|
|
|
7238
7238
|
}
|
|
7239
7239
|
|
|
7240
7240
|
function formatLine(line, outputTruncateLength) {
|
|
7241
|
-
|
|
7241
|
+
var _a;
|
|
7242
|
+
return cliTruncate(line, (outputTruncateLength ?? (((_a = process.stdout) == null ? void 0 : _a.columns) || 80)) - 4);
|
|
7242
7243
|
}
|
|
7243
7244
|
function unifiedDiff(actual, expected, options = {}) {
|
|
7244
7245
|
if (actual === expected)
|
package/dist/{chunk-vite-node-externalize.8560ca65.js → chunk-vite-node-externalize.35ad761d.js}
RENAMED
|
@@ -2,27 +2,27 @@ import { Buffer } from 'buffer';
|
|
|
2
2
|
import path$a from 'path';
|
|
3
3
|
import childProcess from 'child_process';
|
|
4
4
|
import process$1 from 'process';
|
|
5
|
-
import { s as signalExit, m as mergeStream, g as getStream, c as crossSpawn, o as onetime$1 } from './vendor-index.
|
|
5
|
+
import { s as signalExit, m as mergeStream, g as getStream, c as crossSpawn, o as onetime$1 } from './vendor-index.3ff91c47.js';
|
|
6
6
|
import url, { fileURLToPath, pathToFileURL } from 'url';
|
|
7
7
|
import require$$0, { constants as constants$5, cpus, hostname } from 'os';
|
|
8
|
-
import { c as commonjsGlobal, j as join, h as basename, d as dirname, k as resolve, p as picocolors, s as slash$2, l as isAbsolute, m as relative, o as
|
|
8
|
+
import { c as commonjsGlobal, j as join, h as basename, d as dirname, k as resolve, p as picocolors, s as slash$2, l as isAbsolute, m as relative, o as isNode, q as getTests, u as getFullName, v as hasFailed, w as hasFailedSnapshot, x as getSuites, t as toArray, y as normalize, n as noop$1, z as deepMerge, A as toNamespacedPath, g as getCallLastIndex, f as notNullish, B as ensurePackageInstalled, C as stdout } from './chunk-utils-global.29e8a0a3.js';
|
|
9
9
|
import { createServer, mergeConfig } from 'vite';
|
|
10
10
|
import fs$8, { promises, existsSync, readFileSync } from 'fs';
|
|
11
|
-
import { d as distDir, a as defaultPort, c as configFiles } from './chunk-constants.
|
|
11
|
+
import { d as distDir, a as defaultPort, c as configFiles } from './chunk-constants.7180775c.js';
|
|
12
12
|
import readline from 'readline';
|
|
13
13
|
import require$$1 from 'util';
|
|
14
14
|
import require$$0$1 from 'stream';
|
|
15
15
|
import require$$2 from 'events';
|
|
16
|
-
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, c as createDebug, t as toFilePath, w as withInlineSourcemap, b as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-utils.
|
|
17
|
-
import { c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage } from './chunk-defaults.
|
|
16
|
+
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, c as createDebug, t as toFilePath, w as withInlineSourcemap, b as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-utils.26c328fa.js';
|
|
17
|
+
import { c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage } from './chunk-defaults.9e0c233e.js';
|
|
18
18
|
import { MessageChannel } from 'worker_threads';
|
|
19
19
|
import { Tinypool } from 'tinypool';
|
|
20
20
|
import { performance } from 'perf_hooks';
|
|
21
|
-
import { e as stripAnsi, h as stringWidth, i as ansiStyles, j as sliceAnsi, k as setInterval, o as clearInterval, q as cliTruncate, c as setTimeout$1, b as parseStacktrace, r as interpretSourcePos, s as stringify$5, u as unifiedDiff, a as posToNumber, l as lineSplitRE, d as clearTimeout$1 } from './chunk-utils-timers.
|
|
21
|
+
import { e as stripAnsi, h as stringWidth, i as ansiStyles, j as sliceAnsi, k as setInterval, o as clearInterval, q as cliTruncate, c as setTimeout$1, b as parseStacktrace, r as interpretSourcePos, s as stringify$5, u as unifiedDiff, a as posToNumber, l as lineSplitRE, d as clearTimeout$1 } from './chunk-utils-timers.64f2cbe8.js';
|
|
22
22
|
import MagicString from './chunk-magic-string.d5e0e473.js';
|
|
23
23
|
import { p as prompts } from './vendor-index.405e58ef.js';
|
|
24
24
|
|
|
25
|
-
var version = "0.12.
|
|
25
|
+
var version = "0.12.6";
|
|
26
26
|
|
|
27
27
|
function stripFinalNewline(input) {
|
|
28
28
|
const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
|
|
@@ -8316,7 +8316,8 @@ const hookSpinnerMap = /* @__PURE__ */ new WeakMap();
|
|
|
8316
8316
|
const pointer = picocolors.exports.yellow(F_POINTER);
|
|
8317
8317
|
const skipped = picocolors.exports.dim(picocolors.exports.gray(F_DOWN));
|
|
8318
8318
|
function getCols(delta = 0) {
|
|
8319
|
-
|
|
8319
|
+
var _a;
|
|
8320
|
+
let length = (_a = process.stdout) == null ? void 0 : _a.columns;
|
|
8320
8321
|
if (!length || isNaN(length))
|
|
8321
8322
|
length = 30;
|
|
8322
8323
|
return Math.max(length + delta, 0);
|
|
@@ -8447,6 +8448,7 @@ function elegantSpinner() {
|
|
|
8447
8448
|
};
|
|
8448
8449
|
}
|
|
8449
8450
|
|
|
8451
|
+
var _a;
|
|
8450
8452
|
const BADGE_PADDING = " ";
|
|
8451
8453
|
const HELP_HINT = `${picocolors.exports.dim("press ")}${picocolors.exports.bold("h")}${picocolors.exports.dim(" to show help")}`;
|
|
8452
8454
|
const HELP_UPDATE_SNAP = picocolors.exports.dim("press ") + picocolors.exports.bold(picocolors.exports.yellow("u")) + picocolors.exports.dim(" to update snapshot");
|
|
@@ -8460,19 +8462,19 @@ class BaseReporter {
|
|
|
8460
8462
|
constructor() {
|
|
8461
8463
|
this.start = 0;
|
|
8462
8464
|
this.end = 0;
|
|
8463
|
-
this.isTTY = process.stdout.isTTY && !process.env.CI;
|
|
8465
|
+
this.isTTY = isNode && ((_a = process.stdout) == null ? void 0 : _a.isTTY) && !process.env.CI;
|
|
8464
8466
|
this.ctx = void 0;
|
|
8465
8467
|
this.registerUnhandledRejection();
|
|
8466
8468
|
}
|
|
8467
8469
|
onInit(ctx) {
|
|
8468
|
-
var
|
|
8470
|
+
var _a2, _b;
|
|
8469
8471
|
this.ctx = ctx;
|
|
8470
8472
|
this.ctx.log();
|
|
8471
8473
|
const versionTest = this.ctx.config.watch ? picocolors.exports.blue(`v${version}`) : picocolors.exports.cyan(`v${version}`);
|
|
8472
8474
|
const mode = this.ctx.config.watch ? picocolors.exports.blue(" DEV ") : picocolors.exports.cyan(" RUN ");
|
|
8473
8475
|
this.ctx.log(`${picocolors.exports.inverse(picocolors.exports.bold(mode))} ${versionTest} ${picocolors.exports.gray(this.ctx.config.root)}`);
|
|
8474
8476
|
if (this.ctx.config.ui)
|
|
8475
|
-
this.ctx.log(picocolors.exports.dim(picocolors.exports.green(` UI started at http://${((
|
|
8477
|
+
this.ctx.log(picocolors.exports.dim(picocolors.exports.green(` UI started at http://${((_a2 = this.ctx.config.api) == null ? void 0 : _a2.host) || "localhost"}:${picocolors.exports.bold(`${this.ctx.server.config.server.port}`)}`)));
|
|
8476
8478
|
else if (this.ctx.config.api)
|
|
8477
8479
|
this.ctx.log(picocolors.exports.dim(picocolors.exports.green(` API started at http://${((_b = this.ctx.config.api) == null ? void 0 : _b.host) || "localhost"}:${picocolors.exports.bold(`${this.ctx.config.api.port}`)}`)));
|
|
8478
8480
|
this.ctx.log();
|
|
@@ -8498,16 +8500,16 @@ Please, resolve all the errors to make sure your tests are not affected.`));
|
|
|
8498
8500
|
}
|
|
8499
8501
|
}
|
|
8500
8502
|
onTaskUpdate(packs) {
|
|
8501
|
-
var
|
|
8503
|
+
var _a2, _b, _c;
|
|
8502
8504
|
if (this.isTTY)
|
|
8503
8505
|
return;
|
|
8504
8506
|
for (const pack of packs) {
|
|
8505
8507
|
const task = this.ctx.state.idMap.get(pack[0]);
|
|
8506
|
-
if (task && "filepath" in task && ((
|
|
8508
|
+
if (task && "filepath" in task && ((_a2 = task.result) == null ? void 0 : _a2.state) && ((_b = task.result) == null ? void 0 : _b.state) !== "run") {
|
|
8507
8509
|
const tests = getTests(task);
|
|
8508
8510
|
const failed = tests.filter((t) => {
|
|
8509
|
-
var
|
|
8510
|
-
return ((
|
|
8511
|
+
var _a3;
|
|
8512
|
+
return ((_a3 = t.result) == null ? void 0 : _a3.state) === "fail";
|
|
8511
8513
|
});
|
|
8512
8514
|
const skipped = tests.filter((t) => t.mode === "skip" || t.mode === "todo");
|
|
8513
8515
|
let state = picocolors.exports.dim(`${tests.length} test${tests.length > 1 ? "s" : ""}`);
|
|
@@ -8563,10 +8565,10 @@ ${picocolors.exports.inverse(picocolors.exports.bold(picocolors.exports.blue(" R
|
|
|
8563
8565
|
`);
|
|
8564
8566
|
}
|
|
8565
8567
|
shouldLog(log) {
|
|
8566
|
-
var
|
|
8568
|
+
var _a2, _b;
|
|
8567
8569
|
if (this.ctx.config.silent)
|
|
8568
8570
|
return false;
|
|
8569
|
-
const shouldIgnore = (_b = (
|
|
8571
|
+
const shouldIgnore = (_b = (_a2 = this.ctx.config).onConsoleLog) == null ? void 0 : _b.call(_a2, log.content, log.type);
|
|
8570
8572
|
if (shouldIgnore === false)
|
|
8571
8573
|
return shouldIgnore;
|
|
8572
8574
|
return true;
|
|
@@ -8578,12 +8580,12 @@ ${picocolors.exports.inverse(picocolors.exports.bold(picocolors.exports.blue(" R
|
|
|
8578
8580
|
const suites = getSuites(files);
|
|
8579
8581
|
const tests = getTests(files);
|
|
8580
8582
|
const failedSuites = suites.filter((i) => {
|
|
8581
|
-
var
|
|
8582
|
-
return (
|
|
8583
|
+
var _a2;
|
|
8584
|
+
return (_a2 = i.result) == null ? void 0 : _a2.error;
|
|
8583
8585
|
});
|
|
8584
8586
|
const failedTests = tests.filter((i) => {
|
|
8585
|
-
var
|
|
8586
|
-
return ((
|
|
8587
|
+
var _a2;
|
|
8588
|
+
return ((_a2 = i.result) == null ? void 0 : _a2.state) === "fail";
|
|
8587
8589
|
});
|
|
8588
8590
|
const failedTotal = failedSuites.length + failedTests.length;
|
|
8589
8591
|
let current = 1;
|
|
@@ -8601,8 +8603,8 @@ ${picocolors.exports.inverse(picocolors.exports.bold(picocolors.exports.blue(" R
|
|
|
8601
8603
|
}
|
|
8602
8604
|
const executionTime = this.end - this.start;
|
|
8603
8605
|
const threadTime = files.reduce((acc, test) => {
|
|
8604
|
-
var
|
|
8605
|
-
return acc + Math.max(0, ((
|
|
8606
|
+
var _a2;
|
|
8607
|
+
return acc + Math.max(0, ((_a2 = test.result) == null ? void 0 : _a2.duration) || 0) + Math.max(0, test.collectDuration || 0);
|
|
8606
8608
|
}, 0);
|
|
8607
8609
|
const padTitle = (str) => picocolors.exports.dim(`${str.padStart(10)} `);
|
|
8608
8610
|
const time = (time2) => {
|
|
@@ -8625,13 +8627,13 @@ ${picocolors.exports.inverse(picocolors.exports.bold(picocolors.exports.blue(" R
|
|
|
8625
8627
|
this.ctx.log();
|
|
8626
8628
|
}
|
|
8627
8629
|
async printTaskErrors(tasks, errorDivider) {
|
|
8628
|
-
var
|
|
8630
|
+
var _a2;
|
|
8629
8631
|
const errorsQueue = [];
|
|
8630
8632
|
for (const task of tasks) {
|
|
8631
|
-
const error = (
|
|
8633
|
+
const error = (_a2 = task.result) == null ? void 0 : _a2.error;
|
|
8632
8634
|
const errorItem = (error == null ? void 0 : error.stackStr) && errorsQueue.find((i) => {
|
|
8633
|
-
var
|
|
8634
|
-
return ((
|
|
8635
|
+
var _a3;
|
|
8636
|
+
return ((_a3 = i[0]) == null ? void 0 : _a3.stackStr) === error.stackStr;
|
|
8635
8637
|
});
|
|
8636
8638
|
if (errorItem)
|
|
8637
8639
|
errorItem[1].push(task);
|
|
@@ -10161,12 +10163,13 @@ function printStack(ctx, stack, highlight, errorProperties, onStack) {
|
|
|
10161
10163
|
}
|
|
10162
10164
|
}
|
|
10163
10165
|
function generateCodeFrame(source, indent = 0, start = 0, end, range = 2) {
|
|
10166
|
+
var _a;
|
|
10164
10167
|
start = posToNumber(source, start);
|
|
10165
10168
|
end = end || start;
|
|
10166
10169
|
const lines = source.split(lineSplitRE);
|
|
10167
10170
|
let count = 0;
|
|
10168
10171
|
let res = [];
|
|
10169
|
-
const columns = process.stdout.columns || 80;
|
|
10172
|
+
const columns = ((_a = process.stdout) == null ? void 0 : _a.columns) || 80;
|
|
10170
10173
|
function lineNo(no = "") {
|
|
10171
10174
|
return picocolors.exports.gray(`${String(no).padStart(3, " ")}| `);
|
|
10172
10175
|
}
|
|
@@ -10468,9 +10471,10 @@ class Vitest {
|
|
|
10468
10471
|
this.console.error(...args);
|
|
10469
10472
|
}
|
|
10470
10473
|
clearScreen() {
|
|
10474
|
+
var _a;
|
|
10471
10475
|
if (this.server.config.clearScreen === false)
|
|
10472
10476
|
return;
|
|
10473
|
-
const repeatCount = process.stdout.rows - 2;
|
|
10477
|
+
const repeatCount = (((_a = process.stdout) == null ? void 0 : _a.rows) ?? 0) - 2;
|
|
10474
10478
|
const blank = repeatCount > 0 ? "\n".repeat(repeatCount) : "";
|
|
10475
10479
|
this.console.log(blank);
|
|
10476
10480
|
readline.cursorTo(process.stdout, 0, 0);
|
|
@@ -10949,7 +10953,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest()) {
|
|
|
10949
10953
|
await ctx.setServer(options, server);
|
|
10950
10954
|
haveStarted = true;
|
|
10951
10955
|
if (options.api && options.watch)
|
|
10952
|
-
(await import('./chunk-api-setup.
|
|
10956
|
+
(await import('./chunk-api-setup.02588d9f.js')).setup(ctx);
|
|
10953
10957
|
if (!options.watch)
|
|
10954
10958
|
await server.watcher.close();
|
|
10955
10959
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { builtinModules, createRequire } from 'module';
|
|
2
2
|
import { pathToFileURL, fileURLToPath as fileURLToPath$2, URL as URL$1 } from 'url';
|
|
3
3
|
import vm from 'vm';
|
|
4
|
-
import { l as isAbsolute$2, k as resolve, j as join$2,
|
|
4
|
+
import { l as isAbsolute$2, k as resolve, j as join$2, D as extname$2, E as getDefaultExportFromCjs, d as dirname$2 } from './chunk-utils-global.29e8a0a3.js';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import fs, { realpathSync, statSync, Stats, promises, existsSync } from 'fs';
|
|
7
7
|
import assert from 'assert';
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { p as picocolors } from './chunk-utils-global.
|
|
3
|
-
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.
|
|
2
|
+
import { p as picocolors } from './chunk-utils-global.29e8a0a3.js';
|
|
3
|
+
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.35ad761d.js';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'local-pkg';
|
|
6
6
|
import 'path';
|
|
7
7
|
import 'buffer';
|
|
8
8
|
import 'child_process';
|
|
9
9
|
import 'process';
|
|
10
|
-
import './vendor-index.
|
|
10
|
+
import './vendor-index.3ff91c47.js';
|
|
11
11
|
import 'fs';
|
|
12
12
|
import 'assert';
|
|
13
13
|
import 'stream';
|
|
@@ -15,16 +15,16 @@ import 'util';
|
|
|
15
15
|
import 'url';
|
|
16
16
|
import 'os';
|
|
17
17
|
import 'vite';
|
|
18
|
-
import './chunk-constants.
|
|
18
|
+
import './chunk-constants.7180775c.js';
|
|
19
19
|
import 'readline';
|
|
20
|
-
import './chunk-vite-node-utils.
|
|
20
|
+
import './chunk-vite-node-utils.26c328fa.js';
|
|
21
21
|
import 'module';
|
|
22
22
|
import 'vm';
|
|
23
|
-
import './chunk-defaults.
|
|
23
|
+
import './chunk-defaults.9e0c233e.js';
|
|
24
24
|
import 'worker_threads';
|
|
25
25
|
import 'tinypool';
|
|
26
26
|
import 'perf_hooks';
|
|
27
|
-
import './chunk-utils-timers.
|
|
27
|
+
import './chunk-utils-timers.64f2cbe8.js';
|
|
28
28
|
import './chunk-magic-string.d5e0e473.js';
|
|
29
29
|
import './vendor-index.405e58ef.js';
|
|
30
30
|
|
package/dist/entry.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export { r as run } from './vendor-entry.
|
|
1
|
+
export { r as run } from './vendor-entry.5c1e6d94.js';
|
|
2
2
|
import 'fs';
|
|
3
|
-
import './chunk-utils-global.
|
|
3
|
+
import './chunk-utils-global.29e8a0a3.js';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'local-pkg';
|
|
6
6
|
import 'path';
|
|
7
|
-
import './chunk-runtime-chain.
|
|
7
|
+
import './chunk-runtime-chain.5cae775c.js';
|
|
8
8
|
import 'chai';
|
|
9
|
-
import './chunk-runtime-rpc.
|
|
10
|
-
import './chunk-utils-timers.
|
|
9
|
+
import './chunk-runtime-rpc.ad208eea.js';
|
|
10
|
+
import './chunk-utils-timers.64f2cbe8.js';
|
|
11
11
|
import './chunk-integrations-spy.bee66426.js';
|
|
12
12
|
import 'tinyspy';
|
|
13
13
|
import 'util';
|
|
14
|
-
import './chunk-defaults.
|
|
14
|
+
import './chunk-defaults.9e0c233e.js';
|
|
15
15
|
import 'module';
|
|
16
16
|
import 'url';
|
package/dist/index.d.ts
CHANGED
|
@@ -1551,6 +1551,7 @@ declare const vi: VitestUtils;
|
|
|
1551
1551
|
|
|
1552
1552
|
declare function getRunningMode(): "run" | "watch";
|
|
1553
1553
|
declare function isWatchMode(): boolean;
|
|
1554
|
+
declare function toString(value: any): string;
|
|
1554
1555
|
|
|
1555
1556
|
interface TransformResultWithSource extends TransformResult {
|
|
1556
1557
|
source?: string;
|
|
@@ -1676,4 +1677,4 @@ declare global {
|
|
|
1676
1677
|
}
|
|
1677
1678
|
}
|
|
1678
1679
|
|
|
1679
|
-
export { ApiConfig, ArgumentsType$1 as ArgumentsType, Arrayable, Awaitable, BuiltinEnvironment, C8Options, Constructable, CoverageReporter, DeepMerge, DoneCallback, EnhancedSpy, Environment, EnvironmentOptions, EnvironmentReturn, ErrorWithDiff, File, HookCleanupCallback, HookListener, InlineConfig, JSDOMOptions, MergeInsertions, MockedFunction, MockedObject, ModuleCache, ModuleGraphData, MutableArray, Nullable, ParsedStack, Position, Reporter, ResolveIdFunction, ResolvedC8Options, ResolvedConfig, RunMode, RuntimeContext, SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, SpyContext, SpyInstance, SpyInstanceFn, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TransformResultWithSource, UncheckedSnapshot, UserConfig, UserConsoleLog, Vitest, WebSocketEvents, WebSocketHandlers, WorkerContext, WorkerGlobalState, WorkerRPC, afterAll, afterEach, beforeAll, beforeEach, createExpect, describe, expect, getRunningMode, isFirstRun, isWatchMode, it, runOnce, suite, test, vi, vitest, withCallback };
|
|
1680
|
+
export { ApiConfig, ArgumentsType$1 as ArgumentsType, Arrayable, Awaitable, BuiltinEnvironment, C8Options, Constructable, CoverageReporter, DeepMerge, DoneCallback, EnhancedSpy, Environment, EnvironmentOptions, EnvironmentReturn, ErrorWithDiff, File, HookCleanupCallback, HookListener, InlineConfig, JSDOMOptions, MergeInsertions, MockedFunction, MockedObject, ModuleCache, ModuleGraphData, MutableArray, Nullable, ParsedStack, Position, Reporter, ResolveIdFunction, ResolvedC8Options, ResolvedConfig, RunMode, RuntimeContext, SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, SpyContext, SpyInstance, SpyInstanceFn, Suite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteHooks, Task, TaskBase, TaskResult, TaskResultPack, TaskState, Test, TestAPI, TestContext, TestFunction, TransformResultWithSource, UncheckedSnapshot, UserConfig, UserConsoleLog, Vitest, WebSocketEvents, WebSocketHandlers, WorkerContext, WorkerGlobalState, WorkerRPC, afterAll, afterEach, beforeAll, beforeEach, createExpect, describe, expect, getRunningMode, isFirstRun, isWatchMode, it, runOnce, suite, test, toString, vi, vitest, withCallback };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { c as afterAll, f as afterEach, b as beforeAll, e as beforeEach, g as createExpect, d as describe, h as expect, k as getRunningMode, a as isFirstRun, l as isWatchMode, i as it, r as runOnce, s as suite, t as test, j as vi, v as vitest, w as withCallback } from './chunk-runtime-chain.
|
|
1
|
+
export { c as afterAll, f as afterEach, b as beforeAll, e as beforeEach, g as createExpect, d as describe, h as expect, k as getRunningMode, a as isFirstRun, l as isWatchMode, i as it, r as runOnce, s as suite, t as test, m as toString, j as vi, v as vitest, w as withCallback } from './chunk-runtime-chain.5cae775c.js';
|
|
2
2
|
export { assert, default as chai, should } from 'chai';
|
|
3
|
-
import './chunk-utils-global.
|
|
3
|
+
import './chunk-utils-global.29e8a0a3.js';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'local-pkg';
|
|
6
6
|
import 'path';
|
|
7
|
-
import './chunk-runtime-rpc.
|
|
7
|
+
import './chunk-runtime-rpc.ad208eea.js';
|
|
8
8
|
import 'fs';
|
|
9
|
-
import './chunk-utils-timers.
|
|
9
|
+
import './chunk-utils-timers.64f2cbe8.js';
|
|
10
10
|
import './chunk-integrations-spy.bee66426.js';
|
|
11
11
|
import 'tinyspy';
|
|
12
12
|
import 'util';
|
package/dist/node.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.
|
|
2
|
-
export { V as VitestRunner } from './chunk-runtime-mocker.
|
|
1
|
+
export { V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.35ad761d.js';
|
|
2
|
+
export { V as VitestRunner } from './chunk-runtime-mocker.43db6608.js';
|
|
3
3
|
import 'buffer';
|
|
4
4
|
import 'path';
|
|
5
5
|
import 'child_process';
|
|
6
6
|
import 'process';
|
|
7
|
-
import './vendor-index.
|
|
8
|
-
import './chunk-utils-global.
|
|
7
|
+
import './vendor-index.3ff91c47.js';
|
|
8
|
+
import './chunk-utils-global.29e8a0a3.js';
|
|
9
9
|
import 'tty';
|
|
10
10
|
import 'local-pkg';
|
|
11
11
|
import 'fs';
|
|
@@ -16,15 +16,15 @@ import 'util';
|
|
|
16
16
|
import 'url';
|
|
17
17
|
import 'os';
|
|
18
18
|
import 'vite';
|
|
19
|
-
import './chunk-constants.
|
|
19
|
+
import './chunk-constants.7180775c.js';
|
|
20
20
|
import 'readline';
|
|
21
|
-
import './chunk-vite-node-utils.
|
|
21
|
+
import './chunk-vite-node-utils.26c328fa.js';
|
|
22
22
|
import 'module';
|
|
23
23
|
import 'vm';
|
|
24
|
-
import './chunk-defaults.
|
|
24
|
+
import './chunk-defaults.9e0c233e.js';
|
|
25
25
|
import 'worker_threads';
|
|
26
26
|
import 'tinypool';
|
|
27
27
|
import 'perf_hooks';
|
|
28
|
-
import './chunk-utils-timers.
|
|
28
|
+
import './chunk-utils-timers.64f2cbe8.js';
|
|
29
29
|
import './chunk-magic-string.d5e0e473.js';
|
|
30
30
|
import './vendor-index.405e58ef.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import {
|
|
2
|
+
import { o as isNode, a as getWorkerState, t as toArray, J as clone, H as getType, m as relative, K as partitionSuiteChildren, L as hasTests, v as hasFailed, u as getFullName, r as resetModules } from './chunk-utils-global.29e8a0a3.js';
|
|
3
3
|
import { importModule } from 'local-pkg';
|
|
4
|
-
import { s as suite, t as test, d as describe, i as it, r as runOnce, a as isFirstRun, b as beforeAll, c as afterAll, e as beforeEach, f as afterEach, w as withCallback, g as createExpect, h as expect, v as vitest, j as vi, k as getRunningMode, l as isWatchMode, m as resetRunOnceCounter, R as RealDate,
|
|
4
|
+
import { s as suite, t as test, d as describe, i as it, r as runOnce, a as isFirstRun, b as beforeAll, c as afterAll, e as beforeEach, f as afterEach, w as withCallback, g as createExpect, h as expect, v as vitest, j as vi, k as getRunningMode, l as isWatchMode, m as toString, n as resetRunOnceCounter, R as RealDate, o as clearCollectorContext, p as defaultSuite, q as setHooks, u as getHooks, x as collectorContext, y as getSnapshotClient, z as setState, A as getFn, B as getState } from './chunk-runtime-chain.5cae775c.js';
|
|
5
5
|
import chai, { assert, should, util } from 'chai';
|
|
6
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
7
|
-
import { d as clearTimeout, c as setTimeout, s as stringify } from './chunk-utils-timers.
|
|
8
|
-
import { t as takeCoverage } from './chunk-defaults.
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.ad208eea.js';
|
|
7
|
+
import { d as clearTimeout, c as setTimeout, s as stringify } from './chunk-utils-timers.64f2cbe8.js';
|
|
8
|
+
import { t as takeCoverage } from './chunk-defaults.9e0c233e.js';
|
|
9
9
|
import { format } from 'util';
|
|
10
10
|
|
|
11
11
|
var index = /*#__PURE__*/Object.freeze({
|
|
@@ -29,7 +29,8 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
29
29
|
vitest: vitest,
|
|
30
30
|
vi: vi,
|
|
31
31
|
getRunningMode: getRunningMode,
|
|
32
|
-
isWatchMode: isWatchMode
|
|
32
|
+
isWatchMode: isWatchMode,
|
|
33
|
+
toString: toString
|
|
33
34
|
});
|
|
34
35
|
|
|
35
36
|
var node = {
|
|
@@ -493,7 +494,7 @@ async function setupGlobalEnv(config) {
|
|
|
493
494
|
if (isNode)
|
|
494
495
|
await setupConsoleLogSpy();
|
|
495
496
|
if (config.globals)
|
|
496
|
-
(await import('./chunk-integrations-globals.
|
|
497
|
+
(await import('./chunk-integrations-globals.cf24723d.js')).registerApiGlobally();
|
|
497
498
|
}
|
|
498
499
|
function setupDefines(defines) {
|
|
499
500
|
for (const key in defines)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import childProcess from 'child_process';
|
|
2
2
|
import path$3 from 'path';
|
|
3
|
-
import { c as commonjsGlobal } from './chunk-utils-global.
|
|
3
|
+
import { c as commonjsGlobal } from './chunk-utils-global.29e8a0a3.js';
|
|
4
4
|
import fs$1 from 'fs';
|
|
5
5
|
import assert$1 from 'assert';
|
|
6
6
|
import require$$2 from 'events';
|
package/dist/worker.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { k as resolve, a as getWorkerState } from './chunk-utils-global.
|
|
2
|
-
import { b as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-utils.
|
|
3
|
-
import { d as distDir } from './chunk-constants.
|
|
4
|
-
import { e as executeInViteNode } from './chunk-runtime-mocker.
|
|
5
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
1
|
+
import { k as resolve, a as getWorkerState } from './chunk-utils-global.29e8a0a3.js';
|
|
2
|
+
import { b as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-utils.26c328fa.js';
|
|
3
|
+
import { d as distDir } from './chunk-constants.7180775c.js';
|
|
4
|
+
import { e as executeInViteNode } from './chunk-runtime-mocker.43db6608.js';
|
|
5
|
+
import { r as rpc } from './chunk-runtime-rpc.ad208eea.js';
|
|
6
6
|
import 'tty';
|
|
7
7
|
import 'local-pkg';
|
|
8
8
|
import 'path';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.6",
|
|
5
5
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vite",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@types/node": "^17.0.31",
|
|
94
94
|
"@types/prompts": "^2.4.0",
|
|
95
95
|
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
96
|
-
"@vitest/ui": "0.12.
|
|
96
|
+
"@vitest/ui": "0.12.6",
|
|
97
97
|
"birpc": "^0.2.2",
|
|
98
98
|
"c8": "^7.11.2",
|
|
99
99
|
"cac": "^6.7.12",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"source-map-js": "^1.0.2",
|
|
121
121
|
"strip-ansi": "^7.0.1",
|
|
122
122
|
"typescript": "^4.6.4",
|
|
123
|
-
"vite-node": "0.12.
|
|
123
|
+
"vite-node": "0.12.6",
|
|
124
124
|
"ws": "^8.6.0"
|
|
125
125
|
},
|
|
126
126
|
"engines": {
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { g as globalApis } from './chunk-constants.153353ee.js';
|
|
2
|
-
import { i as index } from './vendor-entry.5b810598.js';
|
|
3
|
-
import 'url';
|
|
4
|
-
import './chunk-utils-global.03413604.js';
|
|
5
|
-
import 'tty';
|
|
6
|
-
import 'local-pkg';
|
|
7
|
-
import 'path';
|
|
8
|
-
import 'fs';
|
|
9
|
-
import './chunk-runtime-chain.eb563278.js';
|
|
10
|
-
import 'chai';
|
|
11
|
-
import './chunk-runtime-rpc.ef131645.js';
|
|
12
|
-
import './chunk-utils-timers.a0f0fe66.js';
|
|
13
|
-
import './chunk-integrations-spy.bee66426.js';
|
|
14
|
-
import 'tinyspy';
|
|
15
|
-
import 'util';
|
|
16
|
-
import './chunk-defaults.374342ed.js';
|
|
17
|
-
import 'module';
|
|
18
|
-
|
|
19
|
-
function registerApiGlobally() {
|
|
20
|
-
globalApis.forEach((api) => {
|
|
21
|
-
globalThis[api] = index[api];
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { registerApiGlobally };
|