vitest 0.8.5 → 0.9.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/{chunk-api-setup.da2f55ae.js → chunk-api-setup.e8071f5b.js} +4 -4
- package/dist/{chunk-constants.76cf224a.js → chunk-constants.596ee4d5.js} +1 -1
- package/dist/{chunk-defaults.e85b72aa.js → chunk-defaults.731639a8.js} +1 -1
- package/dist/{chunk-integrations-globals.3713535d.js → chunk-integrations-globals.d1145578.js} +5 -6
- package/dist/{chunk-runtime-chain.c86f1eb0.js → chunk-runtime-chain.a5280da7.js} +7 -4
- package/dist/{chunk-runtime-mocker.7cc59bee.js → chunk-runtime-mocker.ff55be7d.js} +3 -4
- package/dist/chunk-runtime-rpc.3f693817.js +7 -0
- package/dist/{chunk-utils-base.aff0a195.js → chunk-utils-global.35d3b35d.js} +18 -1
- package/dist/{chunk-utils-timers.5657f2a4.js → chunk-utils-timers.73950dcb.js} +1 -1
- package/dist/{chunk-vite-node-externalize.e472da7d.js → chunk-vite-node-externalize.2004587d.js} +41 -14
- package/dist/{chunk-vite-node-utils.a6890356.js → chunk-vite-node-utils.5fa30ee7.js} +1 -1
- package/dist/cli.js +6 -6
- package/dist/entry.js +8 -8
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -5
- package/dist/node.d.ts +1 -0
- package/dist/node.js +7 -8
- package/dist/worker.js +5 -6
- package/package.json +3 -3
- package/dist/chunk-runtime-rpc.5263102e.js +0 -8
- package/dist/chunk-utils-global.7bcfa03c.js +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import { c as createBirpc } from './chunk-vite-node-utils.
|
|
2
|
+
import { c as createBirpc } from './chunk-vite-node-utils.5fa30ee7.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 { k as interpretSourcePos, a as parseStacktrace } from './chunk-utils-timers.
|
|
12
|
+
import { A as API_PATH } from './chunk-constants.596ee4d5.js';
|
|
13
|
+
import { k as interpretSourcePos, a as parseStacktrace } from './chunk-utils-timers.73950dcb.js';
|
|
14
14
|
import 'module';
|
|
15
15
|
import 'vm';
|
|
16
|
-
import './chunk-utils-
|
|
16
|
+
import './chunk-utils-global.35d3b35d.js';
|
|
17
17
|
import 'path';
|
|
18
18
|
import 'tty';
|
|
19
19
|
import 'local-pkg';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from 'url';
|
|
2
|
-
import {
|
|
2
|
+
import { w as resolve } from './chunk-utils-global.35d3b35d.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,
|
|
4
|
+
import { t as toArray, w as resolve } from './chunk-utils-global.35d3b35d.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}/**"];
|
package/dist/{chunk-integrations-globals.3713535d.js → chunk-integrations-globals.d1145578.js}
RENAMED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { g as globalApis } from './chunk-constants.
|
|
2
|
-
import { i as index } from './chunk-runtime-chain.
|
|
1
|
+
import { g as globalApis } from './chunk-constants.596ee4d5.js';
|
|
2
|
+
import { i as index } from './chunk-runtime-chain.a5280da7.js';
|
|
3
3
|
import 'url';
|
|
4
|
-
import './chunk-utils-
|
|
4
|
+
import './chunk-utils-global.35d3b35d.js';
|
|
5
5
|
import 'path';
|
|
6
6
|
import 'tty';
|
|
7
7
|
import 'local-pkg';
|
|
8
8
|
import 'util';
|
|
9
|
-
import './chunk-utils-
|
|
10
|
-
import './chunk-utils-timers.5657f2a4.js';
|
|
9
|
+
import './chunk-utils-timers.73950dcb.js';
|
|
11
10
|
import 'chai';
|
|
12
11
|
import './vendor-_commonjsHelpers.34b404ce.js';
|
|
13
|
-
import './chunk-runtime-rpc.
|
|
12
|
+
import './chunk-runtime-rpc.3f693817.js';
|
|
14
13
|
import 'fs';
|
|
15
14
|
import './spy.js';
|
|
16
15
|
import 'tinyspy';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import require$$0, { format as format$1 } from 'util';
|
|
2
|
-
import { i as isObject, t as toArray, n as noop, a as index$1,
|
|
3
|
-
import { g as
|
|
4
|
-
import { s as setTimeout, c as clearTimeout, g as getOriginalPos, p as posToNumber, n as numberToPos, l as lineSplitRE, a as parseStacktrace, u as unifiedDiff } from './chunk-utils-timers.5657f2a4.js';
|
|
2
|
+
import { g as getWorkerState, i as isObject, t as toArray, n as noop, a as index$1, b as getCallLastIndex, s as slash, c as getNames, d as c$1, e as assertTypes, r as resetModules } from './chunk-utils-global.35d3b35d.js';
|
|
3
|
+
import { s as setTimeout, c as clearTimeout, g as getOriginalPos, p as posToNumber, n as numberToPos, l as lineSplitRE, a as parseStacktrace, u as unifiedDiff } from './chunk-utils-timers.73950dcb.js';
|
|
5
4
|
import chai$1, { expect as expect$1, util, assert, should } from 'chai';
|
|
6
5
|
import { c as commonjsRequire, a as commonjsGlobal } from './vendor-_commonjsHelpers.34b404ce.js';
|
|
7
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.3f693817.js';
|
|
8
7
|
import fs, { promises } from 'fs';
|
|
9
8
|
import { isMockFunction, spyOn, fn, spies } from './spy.js';
|
|
10
9
|
|
|
@@ -7095,6 +7094,10 @@ class VitestUtils {
|
|
|
7095
7094
|
globalThis.window[name] = value;
|
|
7096
7095
|
return this;
|
|
7097
7096
|
}
|
|
7097
|
+
resetModules() {
|
|
7098
|
+
resetModules();
|
|
7099
|
+
return this;
|
|
7100
|
+
}
|
|
7098
7101
|
}
|
|
7099
7102
|
const vitest = new VitestUtils();
|
|
7100
7103
|
const vi = vitest;
|
|
@@ -1,9 +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.5fa30ee7.js';
|
|
2
2
|
import { normalizePath } from 'vite';
|
|
3
|
-
import {
|
|
3
|
+
import { g as getWorkerState, B as isWindows, C as mergeSlashes, k as dirname, h as basename, w as resolve } from './chunk-utils-global.35d3b35d.js';
|
|
4
4
|
import { existsSync, readdirSync } from 'fs';
|
|
5
|
-
import { d as distDir } from './chunk-constants.
|
|
6
|
-
import { g as getWorkerState } from './chunk-utils-global.7bcfa03c.js';
|
|
5
|
+
import { d as distDir } from './chunk-constants.596ee4d5.js';
|
|
7
6
|
|
|
8
7
|
var __defProp = Object.defineProperty;
|
|
9
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -248,6 +248,10 @@ const index = {
|
|
|
248
248
|
..._path
|
|
249
249
|
};
|
|
250
250
|
|
|
251
|
+
function getWorkerState() {
|
|
252
|
+
return globalThis.__vitest_worker__;
|
|
253
|
+
}
|
|
254
|
+
|
|
251
255
|
function notNullish(v) {
|
|
252
256
|
return v != null;
|
|
253
257
|
}
|
|
@@ -349,6 +353,19 @@ function partitionSuiteChildren(suite) {
|
|
|
349
353
|
tasksGroups.push(tasksGroup);
|
|
350
354
|
return tasksGroups;
|
|
351
355
|
}
|
|
356
|
+
function resetModules() {
|
|
357
|
+
const modules = getWorkerState().moduleCache;
|
|
358
|
+
const vitestPaths = [
|
|
359
|
+
/\/vitest\/dist\//,
|
|
360
|
+
/vitest-virtual-\w+\/dist/,
|
|
361
|
+
/@vitest\/dist/
|
|
362
|
+
];
|
|
363
|
+
modules.forEach((_, path) => {
|
|
364
|
+
if (vitestPaths.some((re) => re.test(path)))
|
|
365
|
+
return;
|
|
366
|
+
modules.delete(path);
|
|
367
|
+
});
|
|
368
|
+
}
|
|
352
369
|
function getFullName(task) {
|
|
353
370
|
return getNames(task).join(c.dim(" > "));
|
|
354
371
|
}
|
|
@@ -405,4 +422,4 @@ function getCallLastIndex(code) {
|
|
|
405
422
|
return null;
|
|
406
423
|
}
|
|
407
424
|
|
|
408
|
-
export {
|
|
425
|
+
export { extname as A, isWindows as B, mergeSlashes as C, partitionSuiteChildren as D, hasTests as E, index as a, getCallLastIndex as b, getNames as c, c as d, assertTypes as e, notNullish as f, getWorkerState as g, basename as h, isObject as i, join as j, dirname as k, isAbsolute as l, relative as m, noop as n, getTests as o, getFullName as p, hasFailed as q, resetModules as r, slash as s, toArray as t, hasFailedSnapshot as u, getSuites as v, resolve as w, deepMerge as x, toNamespacedPath as y, ensurePackageInstalled as z };
|
package/dist/{chunk-vite-node-externalize.e472da7d.js → chunk-vite-node-externalize.2004587d.js}
RENAMED
|
@@ -5,17 +5,17 @@ import process$2 from 'process';
|
|
|
5
5
|
import { o as onExit, m as mergeStream, g as getStream, c as crossSpawn, a as onetime$1 } from './vendor-index.87b2fc14.js';
|
|
6
6
|
import url, { fileURLToPath, pathToFileURL } from 'url';
|
|
7
7
|
import require$$0, { constants as constants$8, hostname, cpus } from 'os';
|
|
8
|
-
import { j as join,
|
|
8
|
+
import { j as join, h as basename, k as dirname, d as c, s as slash$2, l as isAbsolute, m as relative, o as getTests, p as getFullName, q as hasFailed, u as hasFailedSnapshot, v as getSuites, w as resolve, t as toArray, n as noop$1, x as deepMerge, y as toNamespacedPath, b as getCallLastIndex, f as notNullish, z as ensurePackageInstalled } from './chunk-utils-global.35d3b35d.js';
|
|
9
9
|
import { createServer, mergeConfig } from 'vite';
|
|
10
10
|
import fs$8, { promises, existsSync } 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.596ee4d5.js';
|
|
12
12
|
import require$$0$1 from 'util';
|
|
13
13
|
import require$$0$2 from 'stream';
|
|
14
14
|
import require$$2 from 'events';
|
|
15
|
-
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toFilePath, w as withInlineSourcemap, c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-utils.
|
|
16
|
-
import { c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage } from './chunk-defaults.
|
|
15
|
+
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toFilePath, w as withInlineSourcemap, c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-utils.5fa30ee7.js';
|
|
16
|
+
import { c as configDefaults, r as resolveC8Options, a as cleanCoverage, b as reportCoverage } from './chunk-defaults.731639a8.js';
|
|
17
17
|
import { performance } from 'perf_hooks';
|
|
18
|
-
import { b as stripAnsi, d as stringWidth, e as ansiStyles, f as sliceAnsi, h as setInterval, i as clearInterval, j as cliTruncate, s as setTimeout$1, a as parseStacktrace, k as interpretSourcePos, u as unifiedDiff, p as posToNumber, l as lineSplitRE, c as clearTimeout$1 } from './chunk-utils-timers.
|
|
18
|
+
import { b as stripAnsi, d as stringWidth, e as ansiStyles, f as sliceAnsi, h as setInterval, i as clearInterval, j as cliTruncate, s as setTimeout$1, a as parseStacktrace, k as interpretSourcePos, u as unifiedDiff, p as posToNumber, l as lineSplitRE, c as clearTimeout$1 } from './chunk-utils-timers.73950dcb.js';
|
|
19
19
|
import { a as commonjsGlobal } from './vendor-_commonjsHelpers.34b404ce.js';
|
|
20
20
|
import assert$1 from 'assert';
|
|
21
21
|
import { MessageChannel } from 'worker_threads';
|
|
@@ -24,7 +24,7 @@ import MagicString from './chunk-magic-string.d5e0e473.js';
|
|
|
24
24
|
import require$$0$3 from 'readline';
|
|
25
25
|
import { p as prompts } from './vendor-index.ee829ed6.js';
|
|
26
26
|
|
|
27
|
-
var version = "0.
|
|
27
|
+
var version = "0.9.0";
|
|
28
28
|
|
|
29
29
|
function stripFinalNewline(input) {
|
|
30
30
|
const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
|
|
@@ -10351,9 +10351,7 @@ const ESM_EXT_RE = /\.(es|esm|esm-browser|esm-bundler|es6|module)\.js$/;
|
|
|
10351
10351
|
const ESM_FOLDER_RE = /\/esm\/(.*\.js)$/;
|
|
10352
10352
|
const defaultInline = [
|
|
10353
10353
|
/virtual:/,
|
|
10354
|
-
/\.ts
|
|
10355
|
-
ESM_EXT_RE,
|
|
10356
|
-
ESM_FOLDER_RE
|
|
10354
|
+
/\.ts$/
|
|
10357
10355
|
];
|
|
10358
10356
|
const depsExternal = [
|
|
10359
10357
|
/\.cjs\.js$/,
|
|
@@ -10784,10 +10782,26 @@ class BaseReporter {
|
|
|
10784
10782
|
return;
|
|
10785
10783
|
for (const pack of packs) {
|
|
10786
10784
|
const task = this.ctx.state.idMap.get(pack[0]);
|
|
10787
|
-
if (task &&
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10785
|
+
if (task && "filepath" in task && ((_a = task.result) == null ? void 0 : _a.state) && ((_b = task.result) == null ? void 0 : _b.state) !== "run") {
|
|
10786
|
+
const tests = getTests(task);
|
|
10787
|
+
const failed = tests.filter((t) => {
|
|
10788
|
+
var _a2;
|
|
10789
|
+
return ((_a2 = t.result) == null ? void 0 : _a2.state) === "fail";
|
|
10790
|
+
});
|
|
10791
|
+
const skipped = tests.filter((t) => t.mode === "skip" || t.mode === "todo");
|
|
10792
|
+
let state = c.dim(`${tests.length} test${tests.length > 1 ? "s" : ""}`);
|
|
10793
|
+
if (failed.length)
|
|
10794
|
+
state += ` ${c.dim("|")} ${c.red(`${failed.length} failed`)}`;
|
|
10795
|
+
if (skipped.length)
|
|
10796
|
+
state += ` ${c.dim("|")} ${c.yellow(`${skipped.length} skipped`)}`;
|
|
10797
|
+
let suffix = c.dim(" (") + state + c.dim(")");
|
|
10798
|
+
if (task.result.duration)
|
|
10799
|
+
suffix += c.yellow(` ${Math.round(task.result.duration)}${c.dim("ms")}`);
|
|
10800
|
+
this.ctx.log(` ${getStateSymbol(task)} ${task.name} ${suffix}`);
|
|
10801
|
+
for (const test of failed) {
|
|
10802
|
+
this.ctx.log(c.red(` ${pointer} ${getFullName(test)}`));
|
|
10803
|
+
this.ctx.log(c.red(` ${F_RIGHT} ${(_c = test.result.error) == null ? void 0 : _c.message}`));
|
|
10804
|
+
}
|
|
10791
10805
|
}
|
|
10792
10806
|
}
|
|
10793
10807
|
}
|
|
@@ -12026,6 +12040,19 @@ class VerboseReporter extends DefaultReporter {
|
|
|
12026
12040
|
super();
|
|
12027
12041
|
this.rendererOptions.renderSucceed = true;
|
|
12028
12042
|
}
|
|
12043
|
+
onTaskUpdate(packs) {
|
|
12044
|
+
var _a, _b, _c;
|
|
12045
|
+
if (this.isTTY)
|
|
12046
|
+
return;
|
|
12047
|
+
for (const pack of packs) {
|
|
12048
|
+
const task = this.ctx.state.idMap.get(pack[0]);
|
|
12049
|
+
if (task && task.type === "test" && ((_a = task.result) == null ? void 0 : _a.state) && ((_b = task.result) == null ? void 0 : _b.state) !== "run") {
|
|
12050
|
+
this.ctx.log(` ${getStateSymbol(task)} ${getFullName(task)}`);
|
|
12051
|
+
if (task.result.state === "fail")
|
|
12052
|
+
this.ctx.log(c.red(` ${F_RIGHT} ${(_c = task.result.error) == null ? void 0 : _c.message}`));
|
|
12053
|
+
}
|
|
12054
|
+
}
|
|
12055
|
+
}
|
|
12029
12056
|
}
|
|
12030
12057
|
|
|
12031
12058
|
class IndentedLogger {
|
|
@@ -13454,7 +13481,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest()) {
|
|
|
13454
13481
|
await ctx.setServer(options, server);
|
|
13455
13482
|
haveStarted = true;
|
|
13456
13483
|
if (options.api && options.watch)
|
|
13457
|
-
(await import('./chunk-api-setup.
|
|
13484
|
+
(await import('./chunk-api-setup.e8071f5b.js')).setup(ctx);
|
|
13458
13485
|
if (!options.watch)
|
|
13459
13486
|
await server.watcher.close();
|
|
13460
13487
|
}
|
|
@@ -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 {
|
|
4
|
+
import { l as isAbsolute$2, w as resolve, j as join$2, A as extname$2, k as dirname$2 } from './chunk-utils-global.35d3b35d.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,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { c } from './chunk-utils-
|
|
3
|
-
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.
|
|
2
|
+
import { d as c } from './chunk-utils-global.35d3b35d.js';
|
|
3
|
+
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.2004587d.js';
|
|
4
4
|
import 'path';
|
|
5
5
|
import 'tty';
|
|
6
6
|
import 'local-pkg';
|
|
@@ -16,13 +16,13 @@ import 'util';
|
|
|
16
16
|
import 'url';
|
|
17
17
|
import 'os';
|
|
18
18
|
import 'vite';
|
|
19
|
-
import './chunk-constants.
|
|
20
|
-
import './chunk-vite-node-utils.
|
|
19
|
+
import './chunk-constants.596ee4d5.js';
|
|
20
|
+
import './chunk-vite-node-utils.5fa30ee7.js';
|
|
21
21
|
import 'module';
|
|
22
22
|
import 'vm';
|
|
23
|
-
import './chunk-defaults.
|
|
23
|
+
import './chunk-defaults.731639a8.js';
|
|
24
24
|
import 'perf_hooks';
|
|
25
|
-
import './chunk-utils-timers.
|
|
25
|
+
import './chunk-utils-timers.73950dcb.js';
|
|
26
26
|
import 'worker_threads';
|
|
27
27
|
import 'tinypool';
|
|
28
28
|
import './chunk-magic-string.d5e0e473.js';
|
package/dist/entry.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import { t as toArray,
|
|
2
|
+
import { g as getWorkerState, t as toArray, m as relative, D as partitionSuiteChildren, E as hasTests, q as hasFailed, p as getFullName, r as resetModules } from './chunk-utils-global.35d3b35d.js';
|
|
3
3
|
import { Console } from 'console';
|
|
4
4
|
import { Writable } from 'stream';
|
|
5
5
|
import { importModule } from 'local-pkg';
|
|
6
|
-
import { r as resetRunOnceCounter, i as index, R as RealDate, s as stringify, c as clearContext, d as defaultSuite, a as setHooks, g as getHooks, b as context, e as getSnapshotClient, f as setState, h as getFn, j as getState, v as vi } from './chunk-runtime-chain.
|
|
7
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as takeCoverage } from './chunk-defaults.e85b72aa.js';
|
|
6
|
+
import { r as resetRunOnceCounter, i as index, R as RealDate, s as stringify, c as clearContext, d as defaultSuite, a as setHooks, g as getHooks, b as context, e as getSnapshotClient, f as setState, h as getFn, j as getState, v as vi } from './chunk-runtime-chain.a5280da7.js';
|
|
7
|
+
import { r as rpc } from './chunk-runtime-rpc.3f693817.js';
|
|
8
|
+
import { c as clearTimeout, s as setTimeout } from './chunk-utils-timers.73950dcb.js';
|
|
9
|
+
import { t as takeCoverage } from './chunk-defaults.731639a8.js';
|
|
11
10
|
import { createHash } from 'crypto';
|
|
12
11
|
import { format } from 'util';
|
|
13
12
|
import 'path';
|
|
@@ -403,7 +402,7 @@ async function setupGlobalEnv(config) {
|
|
|
403
402
|
globalSetup = true;
|
|
404
403
|
setupConsoleLogSpy();
|
|
405
404
|
if (config.globals)
|
|
406
|
-
(await import('./chunk-integrations-globals.
|
|
405
|
+
(await import('./chunk-integrations-globals.d1145578.js')).registerApiGlobally();
|
|
407
406
|
}
|
|
408
407
|
function setupDefines(defines) {
|
|
409
408
|
for (const key in defines)
|
|
@@ -907,8 +906,9 @@ async function run(files, config) {
|
|
|
907
906
|
var _a;
|
|
908
907
|
await setupGlobalEnv(config);
|
|
909
908
|
const workerState = getWorkerState();
|
|
910
|
-
workerState.mockMap.clear();
|
|
911
909
|
for (const file of files) {
|
|
910
|
+
workerState.mockMap.clear();
|
|
911
|
+
resetModules();
|
|
912
912
|
const code = await promises.readFile(file, "utf-8");
|
|
913
913
|
const env = ((_a = code.match(/@(?:vitest|jest)-environment\s+?([\w-]+)\b/)) == null ? void 0 : _a[1]) || config.environment || "node";
|
|
914
914
|
if (!["node", "jsdom", "happy-dom"].includes(env))
|
package/dist/index.d.ts
CHANGED
|
@@ -434,6 +434,7 @@ declare class JsonReporter implements Reporter {
|
|
|
434
434
|
|
|
435
435
|
declare class VerboseReporter extends DefaultReporter {
|
|
436
436
|
constructor();
|
|
437
|
+
onTaskUpdate(packs: TaskResultPack[]): void;
|
|
437
438
|
}
|
|
438
439
|
|
|
439
440
|
declare class TapReporter implements Reporter {
|
|
@@ -1377,6 +1378,7 @@ declare class VitestUtils {
|
|
|
1377
1378
|
* `IntersectionObserver`.
|
|
1378
1379
|
*/
|
|
1379
1380
|
stubGlobal(name: string | symbol | number, value: any): this;
|
|
1381
|
+
resetModules(): this;
|
|
1380
1382
|
}
|
|
1381
1383
|
declare const vitest: VitestUtils;
|
|
1382
1384
|
declare const vi: VitestUtils;
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
export { q as afterAll, w as afterEach, p as beforeAll, u as beforeEach, l as describe, x as expect, z as getRunningMode, o as isFirstRun, A as isWatchMode, m as it, n as runOnce, k as suite, t as test, v as vi, y as vitest } from './chunk-runtime-chain.
|
|
1
|
+
export { q as afterAll, w as afterEach, p as beforeAll, u as beforeEach, l as describe, x as expect, z as getRunningMode, o as isFirstRun, A as isWatchMode, m as it, n as runOnce, k as suite, t as test, v as vi, y as vitest } from './chunk-runtime-chain.a5280da7.js';
|
|
2
2
|
export { assert, default as chai, should } from 'chai';
|
|
3
3
|
import 'util';
|
|
4
|
-
import './chunk-utils-
|
|
4
|
+
import './chunk-utils-global.35d3b35d.js';
|
|
5
5
|
import 'path';
|
|
6
6
|
import 'tty';
|
|
7
7
|
import 'local-pkg';
|
|
8
|
-
import './chunk-utils-
|
|
9
|
-
import './chunk-utils-timers.5657f2a4.js';
|
|
8
|
+
import './chunk-utils-timers.73950dcb.js';
|
|
10
9
|
import './vendor-_commonjsHelpers.34b404ce.js';
|
|
11
|
-
import './chunk-runtime-rpc.
|
|
10
|
+
import './chunk-runtime-rpc.3f693817.js';
|
|
12
11
|
import 'fs';
|
|
13
12
|
import './spy.js';
|
|
14
13
|
import 'tinyspy';
|
package/dist/node.d.ts
CHANGED
package/dist/node.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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.2004587d.js';
|
|
2
|
+
export { V as VitestRunner } from './chunk-runtime-mocker.ff55be7d.js';
|
|
3
3
|
import 'buffer';
|
|
4
4
|
import 'path';
|
|
5
5
|
import 'child_process';
|
|
@@ -13,20 +13,19 @@ import 'stream';
|
|
|
13
13
|
import 'util';
|
|
14
14
|
import 'url';
|
|
15
15
|
import 'os';
|
|
16
|
-
import './chunk-utils-
|
|
16
|
+
import './chunk-utils-global.35d3b35d.js';
|
|
17
17
|
import 'tty';
|
|
18
18
|
import 'local-pkg';
|
|
19
19
|
import 'vite';
|
|
20
|
-
import './chunk-constants.
|
|
21
|
-
import './chunk-vite-node-utils.
|
|
20
|
+
import './chunk-constants.596ee4d5.js';
|
|
21
|
+
import './chunk-vite-node-utils.5fa30ee7.js';
|
|
22
22
|
import 'module';
|
|
23
23
|
import 'vm';
|
|
24
|
-
import './chunk-defaults.
|
|
24
|
+
import './chunk-defaults.731639a8.js';
|
|
25
25
|
import 'perf_hooks';
|
|
26
|
-
import './chunk-utils-timers.
|
|
26
|
+
import './chunk-utils-timers.73950dcb.js';
|
|
27
27
|
import 'worker_threads';
|
|
28
28
|
import 'tinypool';
|
|
29
29
|
import './chunk-magic-string.d5e0e473.js';
|
|
30
30
|
import 'readline';
|
|
31
31
|
import './vendor-index.ee829ed6.js';
|
|
32
|
-
import './chunk-utils-global.7bcfa03c.js';
|
package/dist/worker.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c 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.
|
|
6
|
-
import { g as getWorkerState } from './chunk-utils-global.7bcfa03c.js';
|
|
1
|
+
import { w as resolve, g as getWorkerState } from './chunk-utils-global.35d3b35d.js';
|
|
2
|
+
import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-utils.5fa30ee7.js';
|
|
3
|
+
import { d as distDir } from './chunk-constants.596ee4d5.js';
|
|
4
|
+
import { e as executeInViteNode } from './chunk-runtime-mocker.ff55be7d.js';
|
|
5
|
+
import { r as rpc } from './chunk-runtime-rpc.3f693817.js';
|
|
7
6
|
import 'path';
|
|
8
7
|
import 'tty';
|
|
9
8
|
import 'local-pkg';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
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.23",
|
|
94
94
|
"@types/prompts": "^2.4.0",
|
|
95
95
|
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
96
|
-
"@vitest/ui": "0.
|
|
96
|
+
"@vitest/ui": "0.9.0",
|
|
97
97
|
"birpc": "^0.2.2",
|
|
98
98
|
"c8": "^7.11.0",
|
|
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.3",
|
|
123
|
-
"vite-node": "0.
|
|
123
|
+
"vite-node": "0.9.0",
|
|
124
124
|
"ws": "^8.5.0"
|
|
125
125
|
},
|
|
126
126
|
"engines": {
|