vitest 0.23.1 → 0.23.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.d.ts +3 -3
- package/dist/browser.mjs +7 -7
- package/dist/{chunk-api-setup.9e83ca0a.mjs → chunk-api-setup.11cfd513.mjs} +5 -5
- package/dist/{chunk-constants.6196597b.mjs → chunk-constants.71e8a211.mjs} +0 -0
- package/dist/{chunk-install-pkg.e081fc1b.mjs → chunk-install-pkg.3aa3eae6.mjs} +3 -3
- package/dist/{chunk-integrations-globals.b1aa52c3.mjs → chunk-integrations-globals.ad5b1b51.mjs} +6 -6
- package/dist/{chunk-mock-date.f63a5ff2.mjs → chunk-mock-date.2917be60.mjs} +2 -2
- package/dist/{chunk-node-git.6f289b0a.mjs → chunk-node-git.a44b4872.mjs} +4 -4
- package/dist/{chunk-runtime-chain.8bfc559b.mjs → chunk-runtime-chain.7a7f3c3b.mjs} +5 -17
- package/dist/{chunk-runtime-error.252dd130.mjs → chunk-runtime-error.2723946b.mjs} +40 -27
- package/dist/{chunk-runtime-hooks.c6b06bd8.mjs → chunk-runtime-hooks.1a0bc3fd.mjs} +3 -3
- package/dist/{chunk-runtime-mocker.d9690273.mjs → chunk-runtime-mocker.8d4a2494.mjs} +4 -4
- package/dist/{chunk-runtime-rpc.48bd94e3.mjs → chunk-runtime-rpc.00a890d2.mjs} +1 -1
- package/dist/{chunk-utils-source-map.a1647f5f.mjs → chunk-utils-source-map.2be5aa48.mjs} +2 -2
- package/dist/{chunk-vite-node-client.998e04d0.mjs → chunk-vite-node-client.da0a17ff.mjs} +2 -2
- package/dist/{chunk-vite-node-debug.2d8a1dc3.mjs → chunk-vite-node-debug.536c4c5b.mjs} +1 -1
- package/dist/{chunk-vite-node-externalize.3035bd5b.mjs → chunk-vite-node-externalize.f55c4577.mjs} +84 -41
- package/dist/{chunk-vite-node-utils.8a9b3014.mjs → chunk-vite-node-utils.473cd0b2.mjs} +1 -1
- package/dist/cli-wrapper.mjs +4 -4
- package/dist/cli.mjs +9 -9
- package/dist/config.d.ts +1 -1
- package/dist/entry.mjs +7 -7
- package/dist/environments.d.ts +1 -1
- package/dist/{global-ea084c9f.d.ts → global-d05ffb3f.d.ts} +7 -2
- package/dist/{index-5f09f4d0.d.ts → index-60e2a8e1.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +6 -6
- package/dist/loader.mjs +3 -3
- package/dist/node.d.ts +2 -2
- package/dist/node.mjs +9 -9
- package/dist/suite.mjs +5 -5
- package/dist/{vendor-index.731a22f2.mjs → vendor-index.29636037.mjs} +0 -0
- package/dist/{vendor-index.62ce5c33.mjs → vendor-index.2ae8040a.mjs} +0 -0
- package/dist/{vendor-index.13e3bda3.mjs → vendor-index.9d9196cc.mjs} +0 -0
- package/dist/{vendor-index.4aeeb598.mjs → vendor-index.fbec8a81.mjs} +2 -2
- package/dist/worker.mjs +6 -6
- package/package.json +8 -8
package/dist/browser.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { E as EnhancedSpy, r as Mock, u as MockContext, q as MockInstance, v as Mocked, w as MockedClass, o as MockedFunction, p as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, i as it, d as suite, t as test } from './index-
|
|
2
|
-
import { R as ResolvedConfig } from './global-
|
|
3
|
-
export { L as AfterSuiteRunMeta, A as ApiConfig, Y as ArgumentsType, X as Arrayable, P as Awaitable, ae as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, B as BuiltinEnvironment, C as CSSModuleScopeStrategy, a0 as Constructable, ag as CoverageC8Options, af as CoverageIstanbulOptions, ac as CoverageOptions, a9 as CoverageProvider, aa as CoverageProviderModule, ab as CoverageReporter, _ as DeepMerge, D as DoneCallback, a3 as Environment, E as EnvironmentOptions, a2 as EnvironmentReturn, a7 as ErrorWithDiff, a as File, n as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, Z as MergeInsertions, a1 as ModuleCache, M as ModuleGraphData, $ as MutableArray, Q as Nullable, a8 as OnServerRestartHandler, a6 as ParsedStack, a5 as Position, b as Reporter, K as ResolveIdFunction, R as ResolvedConfig, ad as ResolvedCoverageOptions, d as RunMode, r as RuntimeContext, u as SnapshotData, x as SnapshotMatchOptions, y as SnapshotResult, w as SnapshotStateOptions, G as SnapshotSummary, v as SnapshotUpdateState, S as Suite, m as SuiteAPI, p as SuiteCollector, q as SuiteFactory, o as SuiteHooks, i as Task, f as TaskBase, g as TaskResult, T as TaskResultPack, e as TaskState, h as Test, l as TestAPI, s as TestContext, j as TestFunction, k as TestOptions, z as UncheckedSnapshot, U as UserConfig, a4 as UserConsoleLog, t as Vitest, V as VitestEnvironment, c as VitestRunMode, W as WorkerContext, O as WorkerGlobalState, N as WorkerRPC } from './global-
|
|
1
|
+
export { E as EnhancedSpy, r as Mock, u as MockContext, q as MockInstance, v as Mocked, w as MockedClass, o as MockedFunction, p as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, i as it, d as suite, t as test } from './index-60e2a8e1.js';
|
|
2
|
+
import { R as ResolvedConfig } from './global-d05ffb3f.js';
|
|
3
|
+
export { L as AfterSuiteRunMeta, A as ApiConfig, Y as ArgumentsType, X as Arrayable, P as Awaitable, ae as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, B as BuiltinEnvironment, C as CSSModuleScopeStrategy, a0 as Constructable, ag as CoverageC8Options, af as CoverageIstanbulOptions, ac as CoverageOptions, a9 as CoverageProvider, aa as CoverageProviderModule, ab as CoverageReporter, _ as DeepMerge, D as DoneCallback, a3 as Environment, E as EnvironmentOptions, a2 as EnvironmentReturn, a7 as ErrorWithDiff, a as File, n as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, Z as MergeInsertions, a1 as ModuleCache, M as ModuleGraphData, $ as MutableArray, Q as Nullable, a8 as OnServerRestartHandler, a6 as ParsedStack, a5 as Position, b as Reporter, K as ResolveIdFunction, R as ResolvedConfig, ad as ResolvedCoverageOptions, d as RunMode, r as RuntimeContext, u as SnapshotData, x as SnapshotMatchOptions, y as SnapshotResult, w as SnapshotStateOptions, G as SnapshotSummary, v as SnapshotUpdateState, S as Suite, m as SuiteAPI, p as SuiteCollector, q as SuiteFactory, o as SuiteHooks, i as Task, f as TaskBase, g as TaskResult, T as TaskResultPack, e as TaskState, h as Test, l as TestAPI, s as TestContext, j as TestFunction, k as TestOptions, z as UncheckedSnapshot, U as UserConfig, a4 as UserConsoleLog, t as Vitest, V as VitestEnvironment, c as VitestRunMode, W as WorkerContext, O as WorkerGlobalState, N as WorkerRPC } from './global-d05ffb3f.js';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
package/dist/browser.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.
|
|
2
|
-
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './chunk-runtime-hooks.
|
|
3
|
-
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-error.
|
|
1
|
+
export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.7a7f3c3b.mjs';
|
|
2
|
+
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './chunk-runtime-hooks.1a0bc3fd.mjs';
|
|
3
|
+
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-error.2723946b.mjs';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
|
7
7
|
import 'util';
|
|
8
|
-
import './chunk-mock-date.
|
|
8
|
+
import './chunk-mock-date.2917be60.mjs';
|
|
9
9
|
import 'path';
|
|
10
|
-
import './chunk-constants.
|
|
10
|
+
import './chunk-constants.71e8a211.mjs';
|
|
11
11
|
import 'tty';
|
|
12
12
|
import 'url';
|
|
13
13
|
import 'local-pkg';
|
|
14
14
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
15
|
-
import './chunk-runtime-rpc.
|
|
15
|
+
import './chunk-runtime-rpc.00a890d2.mjs';
|
|
16
16
|
import './chunk-utils-timers.b48455ed.mjs';
|
|
17
17
|
import 'fs';
|
|
18
|
-
import './chunk-utils-source-map.
|
|
18
|
+
import './chunk-utils-source-map.2be5aa48.mjs';
|
|
19
19
|
import './spy.mjs';
|
|
20
20
|
import 'tinyspy';
|
|
21
21
|
import 'perf_hooks';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import { c as createBirpc } from './chunk-vite-node-client.
|
|
2
|
+
import { c as createBirpc } from './chunk-vite-node-client.da0a17ff.mjs';
|
|
3
3
|
import require$$0$1 from 'stream';
|
|
4
4
|
import require$$0 from 'zlib';
|
|
5
5
|
import require$$3 from 'net';
|
|
@@ -9,17 +9,17 @@ 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 { i as interpretSourcePos, p as parseStacktrace } from './chunk-utils-source-map.
|
|
12
|
+
import { A as API_PATH } from './chunk-constants.71e8a211.mjs';
|
|
13
|
+
import { i as interpretSourcePos, p as parseStacktrace } from './chunk-utils-source-map.2be5aa48.mjs';
|
|
14
14
|
import 'module';
|
|
15
15
|
import 'vm';
|
|
16
|
-
import './chunk-vite-node-utils.
|
|
16
|
+
import './chunk-vite-node-utils.473cd0b2.mjs';
|
|
17
17
|
import 'path';
|
|
18
18
|
import 'assert';
|
|
19
19
|
import 'util';
|
|
20
20
|
import 'debug';
|
|
21
21
|
import 'tty';
|
|
22
|
-
import './chunk-mock-date.
|
|
22
|
+
import './chunk-mock-date.2917be60.mjs';
|
|
23
23
|
import 'local-pkg';
|
|
24
24
|
|
|
25
25
|
/*! (c) 2020 Andrea Giammarchi */
|
|
File without changes
|
|
@@ -2,10 +2,10 @@ import path$2 from 'path';
|
|
|
2
2
|
import fs$2 from 'fs';
|
|
3
3
|
import util from 'util';
|
|
4
4
|
import childProcess$1 from 'child_process';
|
|
5
|
-
import { p as pathKey, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.
|
|
6
|
-
import { o as onetime$1 } from './vendor-index.
|
|
5
|
+
import { p as pathKey, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.2ae8040a.mjs';
|
|
6
|
+
import { o as onetime$1 } from './vendor-index.9d9196cc.mjs';
|
|
7
7
|
import require$$0 from 'os';
|
|
8
|
-
import { s as signalExit } from './vendor-index.
|
|
8
|
+
import { s as signalExit } from './vendor-index.29636037.mjs';
|
|
9
9
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
10
10
|
import 'buffer';
|
|
11
11
|
import 'stream';
|
package/dist/{chunk-integrations-globals.b1aa52c3.mjs → chunk-integrations-globals.ad5b1b51.mjs}
RENAMED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { k as globalApis } from './chunk-constants.
|
|
2
|
-
import { i as index } from './chunk-runtime-hooks.
|
|
1
|
+
import { k as globalApis } from './chunk-constants.71e8a211.mjs';
|
|
2
|
+
import { i as index } from './chunk-runtime-hooks.1a0bc3fd.mjs';
|
|
3
3
|
import 'tty';
|
|
4
4
|
import 'url';
|
|
5
5
|
import 'path';
|
|
6
|
-
import './chunk-runtime-chain.
|
|
6
|
+
import './chunk-runtime-chain.7a7f3c3b.mjs';
|
|
7
7
|
import 'util';
|
|
8
|
-
import './chunk-mock-date.
|
|
8
|
+
import './chunk-mock-date.2917be60.mjs';
|
|
9
9
|
import 'local-pkg';
|
|
10
10
|
import 'chai';
|
|
11
11
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
12
|
-
import './chunk-runtime-rpc.
|
|
12
|
+
import './chunk-runtime-rpc.00a890d2.mjs';
|
|
13
13
|
import './chunk-utils-timers.b48455ed.mjs';
|
|
14
14
|
import 'fs';
|
|
15
|
-
import './chunk-utils-source-map.
|
|
15
|
+
import './chunk-utils-source-map.2be5aa48.mjs';
|
|
16
16
|
import './spy.mjs';
|
|
17
17
|
import 'tinyspy';
|
|
18
18
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { relative } from 'path';
|
|
2
|
-
import { r as relative$1, p as picocolors, E as EXIT_CODE_RESTART } from './chunk-constants.
|
|
2
|
+
import { r as relative$1, p as picocolors, E as EXIT_CODE_RESTART } from './chunk-constants.71e8a211.mjs';
|
|
3
3
|
import { isPackageExists } from 'local-pkg';
|
|
4
4
|
|
|
5
5
|
const RealDate = Date;
|
|
@@ -273,7 +273,7 @@ async function ensurePackageInstalled(dependency, root) {
|
|
|
273
273
|
message: picocolors.exports.reset(`Do you want to install ${picocolors.exports.green(dependency)}?`)
|
|
274
274
|
});
|
|
275
275
|
if (install) {
|
|
276
|
-
await (await import('./chunk-install-pkg.
|
|
276
|
+
await (await import('./chunk-install-pkg.3aa3eae6.mjs')).installPackage(dependency, { dev: true });
|
|
277
277
|
process.stderr.write(picocolors.exports.yellow(`
|
|
278
278
|
Package ${dependency} installed, re-run the command to start.
|
|
279
279
|
`));
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as resolve } from './chunk-constants.
|
|
2
|
-
import { e as execa } from './vendor-index.
|
|
1
|
+
import { a as resolve } from './chunk-constants.71e8a211.mjs';
|
|
2
|
+
import { e as execa } from './vendor-index.fbec8a81.mjs';
|
|
3
3
|
import 'tty';
|
|
4
4
|
import 'url';
|
|
5
5
|
import 'path';
|
|
6
6
|
import 'buffer';
|
|
7
7
|
import 'child_process';
|
|
8
8
|
import 'process';
|
|
9
|
-
import './vendor-index.
|
|
9
|
+
import './vendor-index.2ae8040a.mjs';
|
|
10
10
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
11
11
|
import 'fs';
|
|
12
12
|
import 'stream';
|
|
13
13
|
import 'util';
|
|
14
14
|
import 'os';
|
|
15
|
-
import './vendor-index.
|
|
15
|
+
import './vendor-index.29636037.mjs';
|
|
16
16
|
import 'assert';
|
|
17
17
|
import 'events';
|
|
18
18
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import util$1 from 'util';
|
|
2
|
-
import { i as isObject, b as getCallLastIndex, s as slash, g as getWorkerState, c as getNames, d as assertTypes, e as getFullName, f as isRunningInTest, n as noop, h as isRunningInBenchmark } from './chunk-mock-date.
|
|
2
|
+
import { i as isObject, b as getCallLastIndex, s as slash, g as getWorkerState, c as getNames, d as assertTypes, e as getFullName, f as isRunningInTest, n as noop, h as isRunningInBenchmark } from './chunk-mock-date.2917be60.mjs';
|
|
3
3
|
import * as chai$2 from 'chai';
|
|
4
4
|
import { expect, AssertionError, util } from 'chai';
|
|
5
5
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
6
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.00a890d2.mjs';
|
|
7
7
|
import fs, { promises } from 'fs';
|
|
8
|
-
import { j as join, d as dirname, p as picocolors } from './chunk-constants.
|
|
9
|
-
import { a as plugins_1, f as format_1, g as getOriginalPos, b as posToNumber, n as numberToPos, l as lineSplitRE, p as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils } from './chunk-utils-source-map.
|
|
8
|
+
import { j as join, d as dirname, p as picocolors } from './chunk-constants.71e8a211.mjs';
|
|
9
|
+
import { a as plugins_1, f as format_1, g as getOriginalPos, b as posToNumber, n as numberToPos, l as lineSplitRE, p as parseStacktrace, u as unifiedDiff, s as stringify, m as matcherUtils } from './chunk-utils-source-map.2be5aa48.mjs';
|
|
10
10
|
import { isMockFunction } from './spy.mjs';
|
|
11
11
|
import { s as safeSetTimeout, a as safeClearTimeout } from './chunk-utils-timers.b48455ed.mjs';
|
|
12
12
|
|
|
@@ -2164,7 +2164,6 @@ If this is a long-running test, pass a timeout value as the last argument or con
|
|
|
2164
2164
|
|
|
2165
2165
|
const fnMap = /* @__PURE__ */ new WeakMap();
|
|
2166
2166
|
const hooksMap = /* @__PURE__ */ new WeakMap();
|
|
2167
|
-
const benchmarkMap = /* @__PURE__ */ new WeakMap();
|
|
2168
2167
|
function setFn(key, fn) {
|
|
2169
2168
|
fnMap.set(key, fn);
|
|
2170
2169
|
}
|
|
@@ -2177,17 +2176,6 @@ function setHooks(key, hooks) {
|
|
|
2177
2176
|
function getHooks(key) {
|
|
2178
2177
|
return hooksMap.get(key);
|
|
2179
2178
|
}
|
|
2180
|
-
async function getBenchmarkFactory(key) {
|
|
2181
|
-
let benchmark = benchmarkMap.get(key);
|
|
2182
|
-
if (!benchmark) {
|
|
2183
|
-
if (!globalThis.EventTarget)
|
|
2184
|
-
await import('./vendor-index.0557b03a.mjs').then(function (n) { return n.i; });
|
|
2185
|
-
const Bench = (await import('tinybench')).default;
|
|
2186
|
-
benchmark = new Bench({});
|
|
2187
|
-
benchmarkMap.set(key, benchmark);
|
|
2188
|
-
}
|
|
2189
|
-
return benchmark;
|
|
2190
|
-
}
|
|
2191
2179
|
|
|
2192
2180
|
const suite = createSuite();
|
|
2193
2181
|
const test = createTest(
|
|
@@ -2382,4 +2370,4 @@ function createBenchmark(fn) {
|
|
|
2382
2370
|
return benchmark;
|
|
2383
2371
|
}
|
|
2384
2372
|
|
|
2385
|
-
export { GLOBAL_EXPECT as G, getDefaultHookTimeout as a, bench as b, createExpect as c, describe as d, globalExpect as e, clearCollectorContext as f, getCurrentSuite as g, defaultSuite as h, it as i, setHooks as j, getHooks as k, collectorContext as l,
|
|
2373
|
+
export { GLOBAL_EXPECT as G, getDefaultHookTimeout as a, bench as b, createExpect as c, describe as d, globalExpect as e, clearCollectorContext as f, getCurrentSuite as g, defaultSuite as h, it as i, setHooks as j, getHooks as k, collectorContext as l, getFn as m, setState as n, getState as o, createSuiteHooks as p, chai$1 as q, suite as s, test as t, withTimeout as w };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { performance } from 'perf_hooks';
|
|
2
2
|
import { t as takeCoverageInsideWorker, p as pLimit } from './chunk-integrations-coverage.99c020eb.mjs';
|
|
3
|
-
import { r as resetRunOnceCounter, i as index, v as vi } from './chunk-runtime-hooks.
|
|
4
|
-
import { k as deepClone, l as getType, o as isNode, g as getWorkerState, R as RealDate, t as toArray, p as relativePath, q as isBrowser, h as isRunningInBenchmark, u as partitionSuiteChildren, v as shuffle, w as hasTests, x as hasFailed, y as createDefer, e as getFullName } from './chunk-mock-date.
|
|
5
|
-
import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as
|
|
6
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
3
|
+
import { r as resetRunOnceCounter, i as index, v as vi } from './chunk-runtime-hooks.1a0bc3fd.mjs';
|
|
4
|
+
import { k as deepClone, l as getType, o as isNode, g as getWorkerState, R as RealDate, t as toArray, p as relativePath, q as isBrowser, h as isRunningInBenchmark, u as partitionSuiteChildren, v as shuffle, w as hasTests, x as hasFailed, y as createDefer, e as getFullName } from './chunk-mock-date.2917be60.mjs';
|
|
5
|
+
import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as getFn, n as setState, G as GLOBAL_EXPECT, o as getState } from './chunk-runtime-chain.7a7f3c3b.mjs';
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.00a890d2.mjs';
|
|
7
7
|
import util$1 from 'util';
|
|
8
8
|
import { util } from 'chai';
|
|
9
|
-
import { s as stringify } from './chunk-utils-source-map.
|
|
9
|
+
import { s as stringify } from './chunk-utils-source-map.2be5aa48.mjs';
|
|
10
10
|
import { e as environments } from './chunk-env-node.ceb43f1c.mjs';
|
|
11
11
|
import { a as safeClearTimeout, s as safeSetTimeout } from './chunk-utils-timers.b48455ed.mjs';
|
|
12
12
|
|
|
@@ -154,7 +154,7 @@ async function setupGlobalEnv(config) {
|
|
|
154
154
|
if (isNode)
|
|
155
155
|
await setupConsoleLogSpy();
|
|
156
156
|
if (config.globals)
|
|
157
|
-
(await import('./chunk-integrations-globals.
|
|
157
|
+
(await import('./chunk-integrations-globals.ad5b1b51.mjs')).registerApiGlobally();
|
|
158
158
|
}
|
|
159
159
|
function setupDefines(defines) {
|
|
160
160
|
for (const key in defines)
|
|
@@ -431,6 +431,11 @@ function calculateHash(parent) {
|
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
+
async function importTinybench() {
|
|
435
|
+
if (!globalThis.EventTarget)
|
|
436
|
+
await import('./vendor-index.0557b03a.mjs').then(function (n) { return n.i; });
|
|
437
|
+
return await import('tinybench');
|
|
438
|
+
}
|
|
434
439
|
const now = Date.now;
|
|
435
440
|
function updateSuiteHookState(suite, name, state) {
|
|
436
441
|
var _a;
|
|
@@ -485,7 +490,7 @@ async function sendTasksUpdate() {
|
|
|
485
490
|
async function runTest(test) {
|
|
486
491
|
var _a, _b;
|
|
487
492
|
if (test.mode !== "run") {
|
|
488
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
493
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.7a7f3c3b.mjs').then(function (n) { return n.q; });
|
|
489
494
|
getSnapshotClient().skipTestSnapshots(test);
|
|
490
495
|
return;
|
|
491
496
|
}
|
|
@@ -501,7 +506,7 @@ async function runTest(test) {
|
|
|
501
506
|
updateTask(test);
|
|
502
507
|
clearModuleMocks();
|
|
503
508
|
if (isNode) {
|
|
504
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
509
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.7a7f3c3b.mjs').then(function (n) { return n.q; });
|
|
505
510
|
await getSnapshotClient().setTest(test);
|
|
506
511
|
}
|
|
507
512
|
const workerState = getWorkerState();
|
|
@@ -561,7 +566,7 @@ async function runTest(test) {
|
|
|
561
566
|
if (isBrowser && test.result.error)
|
|
562
567
|
console.error(test.result.error.message, test.result.error.stackStr);
|
|
563
568
|
if (isNode) {
|
|
564
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
569
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.7a7f3c3b.mjs').then(function (n) { return n.q; });
|
|
565
570
|
getSnapshotClient().clearTest();
|
|
566
571
|
}
|
|
567
572
|
test.result.duration = now() - start;
|
|
@@ -652,6 +657,7 @@ function createBenchmarkResult(name) {
|
|
|
652
657
|
};
|
|
653
658
|
}
|
|
654
659
|
async function runBenchmarkSuit(suite) {
|
|
660
|
+
const { Task, Bench } = await importTinybench();
|
|
655
661
|
const start = performance.now();
|
|
656
662
|
const benchmarkGroup = [];
|
|
657
663
|
const benchmarkSuiteGroup = [];
|
|
@@ -664,7 +670,6 @@ async function runBenchmarkSuit(suite) {
|
|
|
664
670
|
if (benchmarkSuiteGroup.length)
|
|
665
671
|
await Promise.all(benchmarkSuiteGroup.map((subSuite) => runBenchmarkSuit(subSuite)));
|
|
666
672
|
if (benchmarkGroup.length) {
|
|
667
|
-
const benchmarkInstance = await getBenchmarkFactory(suite);
|
|
668
673
|
const defer = createDefer();
|
|
669
674
|
const benchmarkMap = {};
|
|
670
675
|
suite.result = {
|
|
@@ -674,6 +679,7 @@ async function runBenchmarkSuit(suite) {
|
|
|
674
679
|
};
|
|
675
680
|
updateTask(suite);
|
|
676
681
|
benchmarkGroup.forEach((benchmark, idx) => {
|
|
682
|
+
const benchmarkInstance = new Bench(benchmark.options);
|
|
677
683
|
const benchmarkFn = getFn(benchmark);
|
|
678
684
|
benchmark.result = {
|
|
679
685
|
state: "run",
|
|
@@ -682,23 +688,34 @@ async function runBenchmarkSuit(suite) {
|
|
|
682
688
|
};
|
|
683
689
|
const id = idx.toString();
|
|
684
690
|
benchmarkMap[id] = benchmark;
|
|
685
|
-
benchmarkInstance
|
|
691
|
+
const task = new Task(benchmarkInstance, id, benchmarkFn);
|
|
692
|
+
benchmark.task = task;
|
|
686
693
|
updateTask(benchmark);
|
|
687
694
|
});
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
695
|
+
benchmarkGroup.forEach((benchmark) => {
|
|
696
|
+
benchmark.task.addEventListener("complete", (e) => {
|
|
697
|
+
const task = e.task;
|
|
698
|
+
const _benchmark = benchmarkMap[task.name || ""];
|
|
699
|
+
if (_benchmark) {
|
|
700
|
+
const taskRes = task.result;
|
|
701
|
+
const result = _benchmark.result.benchmark;
|
|
702
|
+
Object.assign(result, taskRes);
|
|
703
|
+
updateTask(_benchmark);
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
benchmark.task.addEventListener("error", (e) => {
|
|
707
|
+
defer.reject(e);
|
|
708
|
+
});
|
|
697
709
|
});
|
|
698
|
-
|
|
710
|
+
Promise.all(benchmarkGroup.map(async (benchmark) => {
|
|
711
|
+
await benchmark.task.warmup();
|
|
712
|
+
return await new Promise((resolve) => safeSetTimeout(async () => {
|
|
713
|
+
resolve(await benchmark.task.run());
|
|
714
|
+
}));
|
|
715
|
+
})).then((tasks) => {
|
|
699
716
|
suite.result.duration = performance.now() - start;
|
|
700
717
|
suite.result.state = "pass";
|
|
701
|
-
|
|
718
|
+
tasks.sort((a, b) => a.result.mean - b.result.mean).forEach((cycle, idx) => {
|
|
702
719
|
const benchmark = benchmarkMap[cycle.name || ""];
|
|
703
720
|
benchmark.result.state = "pass";
|
|
704
721
|
if (benchmark) {
|
|
@@ -710,10 +727,6 @@ async function runBenchmarkSuit(suite) {
|
|
|
710
727
|
updateTask(suite);
|
|
711
728
|
defer.resolve(null);
|
|
712
729
|
});
|
|
713
|
-
benchmarkInstance.addEventListener("error", (e) => {
|
|
714
|
-
defer.reject(e);
|
|
715
|
-
});
|
|
716
|
-
benchmarkInstance.run();
|
|
717
730
|
await defer;
|
|
718
731
|
}
|
|
719
732
|
}
|
|
@@ -754,7 +767,7 @@ async function startTestsBrowser(paths, config) {
|
|
|
754
767
|
async function startTestsNode(paths, config) {
|
|
755
768
|
const files = await collectTests(paths, config);
|
|
756
769
|
rpc().onCollected(files);
|
|
757
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
770
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.7a7f3c3b.mjs').then(function (n) { return n.q; });
|
|
758
771
|
getSnapshotClient().clear();
|
|
759
772
|
await runFiles(files, config);
|
|
760
773
|
const coverage = await takeCoverageInsideWorker(config.coverage);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, b as bench, c as createExpect, e as globalExpect } from './chunk-runtime-chain.
|
|
2
|
-
import { g as getWorkerState, R as RealDate, r as resetDate, m as mockDate, a as resetModules } from './chunk-mock-date.
|
|
3
|
-
import { p as parseStacktrace } from './chunk-utils-source-map.
|
|
1
|
+
import { g as getCurrentSuite, w as withTimeout, a as getDefaultHookTimeout, s as suite, t as test, d as describe, i as it, b as bench, c as createExpect, e as globalExpect } from './chunk-runtime-chain.7a7f3c3b.mjs';
|
|
2
|
+
import { g as getWorkerState, R as RealDate, r as resetDate, m as mockDate, a as resetModules } from './chunk-mock-date.2917be60.mjs';
|
|
3
|
+
import { p as parseStacktrace } from './chunk-utils-source-map.2be5aa48.mjs';
|
|
4
4
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
5
5
|
import util from 'util';
|
|
6
6
|
import { spyOn, fn, isMockFunction, spies } from './spy.mjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { V as ViteNodeRunner } from './chunk-vite-node-client.
|
|
1
|
+
import { V as ViteNodeRunner } from './chunk-vite-node-client.da0a17ff.mjs';
|
|
2
2
|
import { normalizePath } from 'vite';
|
|
3
|
-
import { g as getWorkerState, G as mergeSlashes, s as slash, l as getType, H as getAllMockableProperties } from './chunk-mock-date.
|
|
3
|
+
import { g as getWorkerState, G as mergeSlashes, s as slash, l as getType, H as getAllMockableProperties } from './chunk-mock-date.2917be60.mjs';
|
|
4
4
|
import { existsSync, readdirSync } from 'fs';
|
|
5
|
-
import { n as normalizeRequestId, p as pathFromRoot, i as isNodeBuiltin, b as toFilePath } from './chunk-vite-node-utils.
|
|
6
|
-
import { d as dirname, j as join, b as basename, a as resolve, c as distDir } from './chunk-constants.
|
|
5
|
+
import { n as normalizeRequestId, p as pathFromRoot, i as isNodeBuiltin, b as toFilePath } from './chunk-vite-node-utils.473cd0b2.mjs';
|
|
6
|
+
import { d as dirname, j as join, b as basename, a as resolve, c as distDir } from './chunk-constants.71e8a211.mjs';
|
|
7
7
|
|
|
8
8
|
class RefTracker {
|
|
9
9
|
constructor() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as slash, j as notNullish } from './chunk-mock-date.
|
|
2
|
-
import { p as picocolors } from './chunk-constants.
|
|
1
|
+
import { s as slash, j as notNullish } from './chunk-mock-date.2917be60.mjs';
|
|
2
|
+
import { p as picocolors } from './chunk-constants.71e8a211.mjs';
|
|
3
3
|
|
|
4
4
|
var build = {};
|
|
5
5
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
2
|
import { pathToFileURL, fileURLToPath } from 'url';
|
|
3
3
|
import vm from 'vm';
|
|
4
|
-
import { a as resolve, d as dirname, i as isAbsolute, h as extname } from './chunk-constants.
|
|
5
|
-
import { s as slash, n as normalizeRequestId, b as toFilePath, i as isNodeBuiltin, c as isPrimitive, d as normalizeModuleId, m as mergeSlashes } from './chunk-vite-node-utils.
|
|
4
|
+
import { a as resolve, d as dirname, i as isAbsolute, h as extname } from './chunk-constants.71e8a211.mjs';
|
|
5
|
+
import { s as slash, n as normalizeRequestId, b as toFilePath, i as isNodeBuiltin, c as isPrimitive, d as normalizeModuleId, m as mergeSlashes } from './chunk-vite-node-utils.473cd0b2.mjs';
|
|
6
6
|
import createDebug from 'debug';
|
|
7
7
|
|
|
8
8
|
const debugExecute = createDebug("vite-node:client:execute");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, promises } from 'fs';
|
|
2
|
-
import { a as resolve, p as picocolors, j as join } from './chunk-constants.
|
|
2
|
+
import { a as resolve, p as picocolors, j as join } from './chunk-constants.71e8a211.mjs';
|
|
3
3
|
import 'tty';
|
|
4
4
|
import 'url';
|
|
5
5
|
import 'path';
|
package/dist/{chunk-vite-node-externalize.3035bd5b.mjs → chunk-vite-node-externalize.f55c4577.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as resolve, j as join, b as basename, d as dirname, c as distDir, e as rootDir, p as picocolors, i as isAbsolute, r as relative, f as configFiles, g as defaultPort, n as normalize, t as toNamespacedPath, E as EXIT_CODE_RESTART } from './chunk-constants.
|
|
1
|
+
import { a as resolve, j as join, b as basename, d as dirname, c as distDir, e as rootDir, p as picocolors, i as isAbsolute, r as relative, f as configFiles, g as defaultPort, n as normalize, t as toNamespacedPath, E as EXIT_CODE_RESTART } from './chunk-constants.71e8a211.mjs';
|
|
2
2
|
import { p as pLimit, g as getCoverageProvider, C as CoverageProviderMap } from './chunk-integrations-coverage.99c020eb.mjs';
|
|
3
3
|
import { g as getEnvPackageName } from './chunk-env-node.ceb43f1c.mjs';
|
|
4
|
-
import { A as AggregateErrorPonyfill, s as slash$2, o as isNode, p as relativePath, z as getTests, e as getFullName, x as hasFailed, B as hasFailedSnapshot, C as getSuites, j as notNullish, v as shuffle, t as toArray$1, n as noop$1, D as deepMerge, b as getCallLastIndex, E as ensurePackageInstalled, F as stdout } from './chunk-mock-date.
|
|
4
|
+
import { A as AggregateErrorPonyfill, s as slash$2, o as isNode, p as relativePath, z as getTests, e as getFullName, x as hasFailed, B as hasFailedSnapshot, C as getSuites, j as notNullish, v as shuffle, t as toArray$1, n as noop$1, D as deepMerge, b as getCallLastIndex, E as ensurePackageInstalled, F as stdout } from './chunk-mock-date.2917be60.mjs';
|
|
5
5
|
import { loadConfigFromFile, normalizePath, createServer, mergeConfig } from 'vite';
|
|
6
6
|
import path$a from 'path';
|
|
7
7
|
import url, { fileURLToPath } from 'url';
|
|
@@ -12,24 +12,24 @@ import util$2 from 'util';
|
|
|
12
12
|
import require$$0$1 from 'stream';
|
|
13
13
|
import require$$2 from 'events';
|
|
14
14
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
15
|
-
import { c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-client.
|
|
15
|
+
import { c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-client.da0a17ff.mjs';
|
|
16
16
|
import { performance } from 'perf_hooks';
|
|
17
17
|
import createDebug from 'debug';
|
|
18
|
-
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, b as toFilePath, w as withInlineSourcemap } from './chunk-vite-node-utils.
|
|
18
|
+
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, b as toFilePath, w as withInlineSourcemap } from './chunk-vite-node-utils.473cd0b2.mjs';
|
|
19
19
|
import { MessageChannel } from 'worker_threads';
|
|
20
20
|
import { Tinypool } from 'tinypool';
|
|
21
|
-
import { c as stripAnsi, d as cliTruncate, p as parseStacktrace, i as interpretSourcePos, e as stringWidth, h as ansiStyles, j as sliceAnsi, s as stringify$5, u as unifiedDiff, b as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.
|
|
21
|
+
import { c as stripAnsi, d as cliTruncate, p as parseStacktrace, i as interpretSourcePos, e as stringWidth, h as ansiStyles, j as sliceAnsi, s as stringify$5, u as unifiedDiff, b as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.2be5aa48.mjs';
|
|
22
22
|
import { b as safeSetInterval, c as safeClearInterval, s as safeSetTimeout, a as safeClearTimeout } from './chunk-utils-timers.b48455ed.mjs';
|
|
23
23
|
import { resolveModule } from 'local-pkg';
|
|
24
24
|
import { createHash } from 'crypto';
|
|
25
|
-
import { o as onetime } from './vendor-index.
|
|
26
|
-
import { s as signalExit } from './vendor-index.
|
|
25
|
+
import { o as onetime } from './vendor-index.9d9196cc.mjs';
|
|
26
|
+
import { s as signalExit } from './vendor-index.29636037.mjs';
|
|
27
27
|
import MagicString from './chunk-magic-string.56b2b543.mjs';
|
|
28
28
|
import { stripLiteral } from 'strip-literal';
|
|
29
29
|
import require$$0$2 from 'readline';
|
|
30
30
|
import { p as prompts } from './vendor-index.ae96af6e.mjs';
|
|
31
31
|
|
|
32
|
-
var version$1 = "0.23.
|
|
32
|
+
var version$1 = "0.23.2";
|
|
33
33
|
|
|
34
34
|
class EndError extends Error {
|
|
35
35
|
constructor(value) {
|
|
@@ -6853,7 +6853,7 @@ class ViteNodeServer {
|
|
|
6853
6853
|
}, options.debug ?? {});
|
|
6854
6854
|
}
|
|
6855
6855
|
if (options.debug)
|
|
6856
|
-
import('./chunk-vite-node-debug.
|
|
6856
|
+
import('./chunk-vite-node-debug.536c4c5b.mjs').then((r) => this.debugger = new r.Debugger(server.config.root, options.debug));
|
|
6857
6857
|
}
|
|
6858
6858
|
shouldExternalize(id) {
|
|
6859
6859
|
return shouldExternalize(id, this.options.deps, this.externalizeCache);
|
|
@@ -7345,6 +7345,9 @@ class BaseReporter {
|
|
|
7345
7345
|
this._timeStart = new Date();
|
|
7346
7346
|
this.registerUnhandledRejection();
|
|
7347
7347
|
}
|
|
7348
|
+
get mode() {
|
|
7349
|
+
return this.ctx.config.mode;
|
|
7350
|
+
}
|
|
7348
7351
|
onInit(ctx) {
|
|
7349
7352
|
this.ctx = ctx;
|
|
7350
7353
|
ctx.logger.printBanner();
|
|
@@ -7485,31 +7488,15 @@ ${BADGE}${TRIGGER} ${picocolors.exports.blue(`x${rerun}`)}
|
|
|
7485
7488
|
)));
|
|
7486
7489
|
}
|
|
7487
7490
|
async reportSummary(files) {
|
|
7488
|
-
|
|
7489
|
-
|
|
7491
|
+
await this.printErrorsSummary(files);
|
|
7492
|
+
if (this.mode === "benchmark")
|
|
7493
|
+
await this.reportBenchmarkSummary(files);
|
|
7494
|
+
else
|
|
7495
|
+
await this.reportTestSummary(files);
|
|
7496
|
+
}
|
|
7497
|
+
async reportTestSummary(files) {
|
|
7490
7498
|
const tests = getTests(files);
|
|
7491
|
-
const
|
|
7492
|
-
var _a2;
|
|
7493
|
-
return (_a2 = i.result) == null ? void 0 : _a2.error;
|
|
7494
|
-
});
|
|
7495
|
-
const failedTests = tests.filter((i) => {
|
|
7496
|
-
var _a2;
|
|
7497
|
-
return ((_a2 = i.result) == null ? void 0 : _a2.state) === "fail";
|
|
7498
|
-
});
|
|
7499
|
-
const failedTotal = failedSuites.length + failedTests.length;
|
|
7500
|
-
let current = 1;
|
|
7501
|
-
const errorDivider = () => logger.error(`${picocolors.exports.red(picocolors.exports.dim(divider(`[${current++}/${failedTotal}]`, void 0, 1)))}
|
|
7502
|
-
`);
|
|
7503
|
-
if (failedSuites.length) {
|
|
7504
|
-
logger.error(picocolors.exports.red(divider(picocolors.exports.bold(picocolors.exports.inverse(` Failed Suites ${failedSuites.length} `)))));
|
|
7505
|
-
logger.error();
|
|
7506
|
-
await this.printTaskErrors(failedSuites, errorDivider);
|
|
7507
|
-
}
|
|
7508
|
-
if (failedTests.length) {
|
|
7509
|
-
logger.error(picocolors.exports.red(divider(picocolors.exports.bold(picocolors.exports.inverse(` Failed Tests ${failedTests.length} `)))));
|
|
7510
|
-
logger.error();
|
|
7511
|
-
await this.printTaskErrors(failedTests, errorDivider);
|
|
7512
|
-
}
|
|
7499
|
+
const logger = this.ctx.logger;
|
|
7513
7500
|
const executionTime = this.end - this.start;
|
|
7514
7501
|
const collectTime = files.reduce((acc, test) => acc + Math.max(0, test.collectDuration || 0), 0);
|
|
7515
7502
|
const setupTime = files.reduce((acc, test) => acc + Math.max(0, test.setupDuration || 0), 0);
|
|
@@ -7542,6 +7529,59 @@ ${BADGE}${TRIGGER} ${picocolors.exports.blue(`x${rerun}`)}
|
|
|
7542
7529
|
logger.log(padTitle("Duration"), time(executionTime) + picocolors.exports.dim(` (transform ${time(transformTime)}, setup ${time(setupTime)}, collect ${time(collectTime)}, tests ${time(testsTime)})`));
|
|
7543
7530
|
logger.log();
|
|
7544
7531
|
}
|
|
7532
|
+
async printErrorsSummary(files) {
|
|
7533
|
+
const logger = this.ctx.logger;
|
|
7534
|
+
const suites = getSuites(files);
|
|
7535
|
+
const tests = getTests(files);
|
|
7536
|
+
const failedSuites = suites.filter((i) => {
|
|
7537
|
+
var _a2;
|
|
7538
|
+
return (_a2 = i.result) == null ? void 0 : _a2.error;
|
|
7539
|
+
});
|
|
7540
|
+
const failedTests = tests.filter((i) => {
|
|
7541
|
+
var _a2;
|
|
7542
|
+
return ((_a2 = i.result) == null ? void 0 : _a2.state) === "fail";
|
|
7543
|
+
});
|
|
7544
|
+
const failedTotal = failedSuites.length + failedTests.length;
|
|
7545
|
+
let current = 1;
|
|
7546
|
+
const errorDivider = () => logger.error(`${picocolors.exports.red(picocolors.exports.dim(divider(`[${current++}/${failedTotal}]`, void 0, 1)))}
|
|
7547
|
+
`);
|
|
7548
|
+
if (failedSuites.length) {
|
|
7549
|
+
logger.error(picocolors.exports.red(divider(picocolors.exports.bold(picocolors.exports.inverse(` Failed Suites ${failedSuites.length} `)))));
|
|
7550
|
+
logger.error();
|
|
7551
|
+
await this.printTaskErrors(failedSuites, errorDivider);
|
|
7552
|
+
}
|
|
7553
|
+
if (failedTests.length) {
|
|
7554
|
+
logger.error(picocolors.exports.red(divider(picocolors.exports.bold(picocolors.exports.inverse(` Failed Tests ${failedTests.length} `)))));
|
|
7555
|
+
logger.error();
|
|
7556
|
+
await this.printTaskErrors(failedTests, errorDivider);
|
|
7557
|
+
}
|
|
7558
|
+
return tests;
|
|
7559
|
+
}
|
|
7560
|
+
async reportBenchmarkSummary(files) {
|
|
7561
|
+
const logger = this.ctx.logger;
|
|
7562
|
+
const benchs = getTests(files);
|
|
7563
|
+
const topBenchs = benchs.filter((i) => {
|
|
7564
|
+
var _a2, _b;
|
|
7565
|
+
return ((_b = (_a2 = i.result) == null ? void 0 : _a2.benchmark) == null ? void 0 : _b.rank) === 1;
|
|
7566
|
+
});
|
|
7567
|
+
logger.log(`
|
|
7568
|
+
${picocolors.exports.cyan(picocolors.exports.inverse(picocolors.exports.bold(" BENCH ")))} ${picocolors.exports.cyan("Summary")}
|
|
7569
|
+
`);
|
|
7570
|
+
for (const bench of topBenchs) {
|
|
7571
|
+
const group = bench.suite;
|
|
7572
|
+
const groupName = getFullName(group);
|
|
7573
|
+
logger.log(` ${bench.name}${picocolors.exports.dim(` - ${groupName}`)}`);
|
|
7574
|
+
const siblings = group.tasks.filter((i) => {
|
|
7575
|
+
var _a2;
|
|
7576
|
+
return ((_a2 = i.result) == null ? void 0 : _a2.benchmark) && i !== bench;
|
|
7577
|
+
}).sort((a, b) => a.result.benchmark.rank - b.result.benchmark.rank);
|
|
7578
|
+
for (const sibling of siblings) {
|
|
7579
|
+
const number = `${(sibling.result.benchmark.mean / bench.result.benchmark.mean).toFixed(2)}x`;
|
|
7580
|
+
logger.log(` ${picocolors.exports.green(number)} ${picocolors.exports.gray("faster than")} ${sibling.name}`);
|
|
7581
|
+
}
|
|
7582
|
+
logger.log("");
|
|
7583
|
+
}
|
|
7584
|
+
}
|
|
7545
7585
|
async printTaskErrors(tasks, errorDivider) {
|
|
7546
7586
|
var _a2;
|
|
7547
7587
|
const errorsQueue = [];
|
|
@@ -8309,6 +8349,7 @@ class JsonReporter {
|
|
|
8309
8349
|
this.ctx = ctx;
|
|
8310
8350
|
}
|
|
8311
8351
|
async logTasks(files) {
|
|
8352
|
+
var _a;
|
|
8312
8353
|
const suites = getSuites(files);
|
|
8313
8354
|
const numTotalTestSuites = suites.length;
|
|
8314
8355
|
const tests = getTests(files);
|
|
@@ -8318,16 +8359,18 @@ class JsonReporter {
|
|
|
8318
8359
|
for (const file of files) {
|
|
8319
8360
|
const tests2 = getTests([file]);
|
|
8320
8361
|
for (const test of tests2) {
|
|
8321
|
-
const res = test.result.benchmark;
|
|
8362
|
+
const res = (_a = test.result) == null ? void 0 : _a.benchmark;
|
|
8363
|
+
if (!res || test.mode === "skip")
|
|
8364
|
+
continue;
|
|
8322
8365
|
if (!outputFile)
|
|
8323
8366
|
res.samples = "ignore on terminal";
|
|
8324
8367
|
testResults[test.suite.name] = (testResults[test.suite.name] || []).concat(res);
|
|
8325
8368
|
}
|
|
8326
8369
|
if (tests2.some((t) => {
|
|
8327
|
-
var
|
|
8328
|
-
return ((
|
|
8370
|
+
var _a2;
|
|
8371
|
+
return ((_a2 = t.result) == null ? void 0 : _a2.state) === "run";
|
|
8329
8372
|
})) {
|
|
8330
|
-
this.ctx.logger.warn("WARNING: Some tests are still running when generating the
|
|
8373
|
+
this.ctx.logger.warn("WARNING: Some tests are still running when generating the json report.This is likely an internal bug in Vitest.Please report it to https://github.com/vitest-dev/vitest/issues");
|
|
8331
8374
|
}
|
|
8332
8375
|
}
|
|
8333
8376
|
const result = {
|
|
@@ -8348,7 +8391,7 @@ class JsonReporter {
|
|
|
8348
8391
|
if (!existsSync(outputDirectory))
|
|
8349
8392
|
await promises.mkdir(outputDirectory, { recursive: true });
|
|
8350
8393
|
await promises.writeFile(reportFile, report, "utf-8");
|
|
8351
|
-
this.ctx.logger.log(`
|
|
8394
|
+
this.ctx.logger.log(`json report written to ${reportFile}`);
|
|
8352
8395
|
} else {
|
|
8353
8396
|
this.ctx.logger.log(report);
|
|
8354
8397
|
}
|
|
@@ -9373,7 +9416,7 @@ createLogUpdate(process$1.stdout);
|
|
|
9373
9416
|
|
|
9374
9417
|
createLogUpdate(process$1.stderr);
|
|
9375
9418
|
|
|
9376
|
-
var version = "0.23.
|
|
9419
|
+
var version = "0.23.2";
|
|
9377
9420
|
|
|
9378
9421
|
function fileFromParsedStack(stack) {
|
|
9379
9422
|
var _a, _b;
|
|
@@ -9788,7 +9831,7 @@ class Vitest {
|
|
|
9788
9831
|
}
|
|
9789
9832
|
async filterTestsBySource(tests) {
|
|
9790
9833
|
if (this.config.changed && !this.config.related) {
|
|
9791
|
-
const { VitestGit } = await import('./chunk-node-git.
|
|
9834
|
+
const { VitestGit } = await import('./chunk-node-git.a44b4872.mjs');
|
|
9792
9835
|
const vitestGit = new VitestGit(this.config.root);
|
|
9793
9836
|
const related2 = await vitestGit.findChangedFiles({
|
|
9794
9837
|
changedSince: this.config.changed
|
|
@@ -10459,7 +10502,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
|
|
|
10459
10502
|
try {
|
|
10460
10503
|
await ctx.setServer(options, server);
|
|
10461
10504
|
if (options.api && options.watch)
|
|
10462
|
-
(await import('./chunk-api-setup.
|
|
10505
|
+
(await import('./chunk-api-setup.11cfd513.mjs')).setup(ctx);
|
|
10463
10506
|
} catch (err) {
|
|
10464
10507
|
ctx.logger.printError(err, true);
|
|
10465
10508
|
process.exit(1);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pathToFileURL, fileURLToPath as fileURLToPath$1, URL as URL$1 } from 'url';
|
|
2
|
-
import { a as resolve$1, r as relative } from './chunk-constants.
|
|
2
|
+
import { a as resolve$1, r as relative } from './chunk-constants.71e8a211.mjs';
|
|
3
3
|
import { builtinModules } from 'module';
|
|
4
4
|
import fs, { promises, statSync, existsSync, realpathSync, Stats } from 'fs';
|
|
5
5
|
import path from 'path';
|
package/dist/cli-wrapper.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { fileURLToPath } from 'url';
|
|
2
|
-
import { p as picocolors, E as EXIT_CODE_RESTART } from './chunk-constants.
|
|
3
|
-
import { e as execa } from './vendor-index.
|
|
2
|
+
import { p as picocolors, E as EXIT_CODE_RESTART } from './chunk-constants.71e8a211.mjs';
|
|
3
|
+
import { e as execa } from './vendor-index.fbec8a81.mjs';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'path';
|
|
6
6
|
import 'buffer';
|
|
7
7
|
import 'child_process';
|
|
8
8
|
import 'process';
|
|
9
|
-
import './vendor-index.
|
|
9
|
+
import './vendor-index.2ae8040a.mjs';
|
|
10
10
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
11
11
|
import 'fs';
|
|
12
12
|
import 'stream';
|
|
13
13
|
import 'util';
|
|
14
14
|
import 'os';
|
|
15
|
-
import './vendor-index.
|
|
15
|
+
import './vendor-index.29636037.mjs';
|
|
16
16
|
import 'assert';
|
|
17
17
|
import 'events';
|
|
18
18
|
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { p as picocolors } from './chunk-constants.
|
|
3
|
-
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.
|
|
2
|
+
import { p as picocolors } from './chunk-constants.71e8a211.mjs';
|
|
3
|
+
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.f55c4577.mjs';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'url';
|
|
6
6
|
import 'path';
|
|
@@ -8,7 +8,7 @@ import './chunk-integrations-coverage.99c020eb.mjs';
|
|
|
8
8
|
import 'local-pkg';
|
|
9
9
|
import './chunk-env-node.ceb43f1c.mjs';
|
|
10
10
|
import 'console';
|
|
11
|
-
import './chunk-mock-date.
|
|
11
|
+
import './chunk-mock-date.2917be60.mjs';
|
|
12
12
|
import 'vite';
|
|
13
13
|
import 'process';
|
|
14
14
|
import 'fs';
|
|
@@ -16,20 +16,20 @@ import 'os';
|
|
|
16
16
|
import 'util';
|
|
17
17
|
import 'stream';
|
|
18
18
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
19
|
-
import './chunk-vite-node-client.
|
|
19
|
+
import './chunk-vite-node-client.da0a17ff.mjs';
|
|
20
20
|
import 'module';
|
|
21
21
|
import 'vm';
|
|
22
|
-
import './chunk-vite-node-utils.
|
|
22
|
+
import './chunk-vite-node-utils.473cd0b2.mjs';
|
|
23
23
|
import 'assert';
|
|
24
24
|
import 'debug';
|
|
25
25
|
import 'perf_hooks';
|
|
26
26
|
import 'worker_threads';
|
|
27
27
|
import 'tinypool';
|
|
28
|
-
import './chunk-utils-source-map.
|
|
28
|
+
import './chunk-utils-source-map.2be5aa48.mjs';
|
|
29
29
|
import './chunk-utils-timers.b48455ed.mjs';
|
|
30
30
|
import 'crypto';
|
|
31
|
-
import './vendor-index.
|
|
32
|
-
import './vendor-index.
|
|
31
|
+
import './vendor-index.9d9196cc.mjs';
|
|
32
|
+
import './vendor-index.29636037.mjs';
|
|
33
33
|
import './chunk-magic-string.56b2b543.mjs';
|
|
34
34
|
import 'strip-literal';
|
|
35
35
|
import 'readline';
|
|
@@ -671,7 +671,7 @@ async function run(cliFilters, options) {
|
|
|
671
671
|
await start("test", cliFilters, options);
|
|
672
672
|
}
|
|
673
673
|
async function benchmark(cliFilters, options) {
|
|
674
|
-
console.warn(picocolors.exports.yellow("Benchmarking is an experimental feature
|
|
674
|
+
console.warn(picocolors.exports.yellow("Benchmarking is an experimental feature.\nBreaking changes might not follow semver, please pin Vitest's version when using it."));
|
|
675
675
|
await start("benchmark", cliFilters, options);
|
|
676
676
|
}
|
|
677
677
|
async function start(mode, cliFilters, options) {
|
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UserConfig as UserConfig$2, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv } from 'vite';
|
|
3
|
-
import { U as UserConfig$1, ad as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './global-
|
|
3
|
+
import { U as UserConfig$1, ad as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './global-d05ffb3f.js';
|
|
4
4
|
import 'tinybench';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'worker_threads';
|
package/dist/entry.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import { g as getWorkerState, a as resetModules } from './chunk-mock-date.
|
|
2
|
+
import { g as getWorkerState, a as resetModules } from './chunk-mock-date.2917be60.mjs';
|
|
3
3
|
import { a as envs } from './chunk-env-node.ceb43f1c.mjs';
|
|
4
|
-
import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-error.
|
|
4
|
+
import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-error.2723946b.mjs';
|
|
5
5
|
import 'path';
|
|
6
|
-
import './chunk-constants.
|
|
6
|
+
import './chunk-constants.71e8a211.mjs';
|
|
7
7
|
import 'tty';
|
|
8
8
|
import 'url';
|
|
9
9
|
import 'local-pkg';
|
|
10
10
|
import 'console';
|
|
11
11
|
import 'perf_hooks';
|
|
12
12
|
import './chunk-integrations-coverage.99c020eb.mjs';
|
|
13
|
-
import './chunk-runtime-hooks.
|
|
14
|
-
import './chunk-runtime-chain.
|
|
13
|
+
import './chunk-runtime-hooks.1a0bc3fd.mjs';
|
|
14
|
+
import './chunk-runtime-chain.7a7f3c3b.mjs';
|
|
15
15
|
import 'util';
|
|
16
16
|
import 'chai';
|
|
17
17
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
18
|
-
import './chunk-runtime-rpc.
|
|
18
|
+
import './chunk-runtime-rpc.00a890d2.mjs';
|
|
19
19
|
import './chunk-utils-timers.b48455ed.mjs';
|
|
20
|
-
import './chunk-utils-source-map.
|
|
20
|
+
import './chunk-utils-source-map.2be5aa48.mjs';
|
|
21
21
|
import './spy.mjs';
|
|
22
22
|
import 'tinyspy';
|
|
23
23
|
|
package/dist/environments.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ViteDevServer, TransformResult as TransformResult$1, UserConfig as UserConfig$1, CommonServerOptions, AliasOptions } from 'vite';
|
|
2
|
-
import { Options, TaskResult as TaskResult$1, Bench } from 'tinybench';
|
|
2
|
+
import { Task as Task$1, Options, TaskResult as TaskResult$1, Bench } from 'tinybench';
|
|
3
3
|
import { Stats } from 'fs';
|
|
4
4
|
import { MessagePort } from 'worker_threads';
|
|
5
5
|
|
|
@@ -603,6 +603,7 @@ declare abstract class BaseReporter implements Reporter {
|
|
|
603
603
|
private _lastRunCount;
|
|
604
604
|
private _timeStart;
|
|
605
605
|
constructor();
|
|
606
|
+
get mode(): VitestRunMode;
|
|
606
607
|
onInit(ctx: Vitest): void;
|
|
607
608
|
relative(path: string): string;
|
|
608
609
|
onFinished(files?: File[], errors?: unknown[]): Promise<void>;
|
|
@@ -614,6 +615,9 @@ declare abstract class BaseReporter implements Reporter {
|
|
|
614
615
|
shouldLog(log: UserConsoleLog): boolean;
|
|
615
616
|
onServerRestart(reason?: string): void;
|
|
616
617
|
reportSummary(files: File[]): Promise<void>;
|
|
618
|
+
reportTestSummary(files: File[]): Promise<void>;
|
|
619
|
+
private printErrorsSummary;
|
|
620
|
+
reportBenchmarkSummary(files: File[]): Promise<void>;
|
|
617
621
|
private printTaskErrors;
|
|
618
622
|
registerUnhandledRejection(): void;
|
|
619
623
|
}
|
|
@@ -1040,7 +1044,7 @@ interface BenchmarkUserOptions {
|
|
|
1040
1044
|
*/
|
|
1041
1045
|
exclude?: string[];
|
|
1042
1046
|
/**
|
|
1043
|
-
* Include globs for in-source test files
|
|
1047
|
+
* Include globs for in-source benchmark test files
|
|
1044
1048
|
*
|
|
1045
1049
|
* @default []
|
|
1046
1050
|
*/
|
|
@@ -1056,6 +1060,7 @@ interface Benchmark extends TaskBase {
|
|
|
1056
1060
|
suite: Suite;
|
|
1057
1061
|
result?: TaskResult;
|
|
1058
1062
|
fails?: boolean;
|
|
1063
|
+
task?: Task$1;
|
|
1059
1064
|
options: Options;
|
|
1060
1065
|
}
|
|
1061
1066
|
interface BenchmarkResult extends TaskResult$1 {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpyImpl } from 'tinyspy';
|
|
2
|
-
import { m as SuiteAPI, l as TestAPI, al as BenchmarkAPI, o as SuiteHooks, H as HookListener, s as TestContext, S as Suite, n as HookCleanupCallback, h as Test } from './global-
|
|
2
|
+
import { m as SuiteAPI, l as TestAPI, al as BenchmarkAPI, o as SuiteHooks, H as HookListener, s as TestContext, S as Suite, n as HookCleanupCallback, h as Test } from './global-d05ffb3f.js';
|
|
3
3
|
|
|
4
4
|
interface MockResultReturn<T> {
|
|
5
5
|
type: 'return';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as spyOn, f as fn, M as MaybeMockedDeep, a as MaybeMocked, b as MaybePartiallyMocked, c as MaybePartiallyMockedDeep, E as EnhancedSpy } from './index-
|
|
2
|
-
export { E as EnhancedSpy, r as Mock, u as MockContext, q as MockInstance, v as Mocked, w as MockedClass, o as MockedFunction, p as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, i as it, d as suite, t as test } from './index-
|
|
3
|
-
import { D as DoneCallback, F as FakeTimerInstallOpts, a as File, T as TaskResultPack, R as ResolvedConfig, M as ModuleGraphData, b as Reporter } from './global-
|
|
4
|
-
export { L as AfterSuiteRunMeta, A as ApiConfig, Y as ArgumentsType, X as Arrayable, P as Awaitable, ae as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, B as BuiltinEnvironment, C as CSSModuleScopeStrategy, a0 as Constructable, ag as CoverageC8Options, af as CoverageIstanbulOptions, ac as CoverageOptions, a9 as CoverageProvider, aa as CoverageProviderModule, ab as CoverageReporter, _ as DeepMerge, D as DoneCallback, a3 as Environment, E as EnvironmentOptions, a2 as EnvironmentReturn, a7 as ErrorWithDiff, a as File, n as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, Z as MergeInsertions, a1 as ModuleCache, M as ModuleGraphData, $ as MutableArray, Q as Nullable, a8 as OnServerRestartHandler, a6 as ParsedStack, a5 as Position, b as Reporter, K as ResolveIdFunction, R as ResolvedConfig, ad as ResolvedCoverageOptions, d as RunMode, r as RuntimeContext, u as SnapshotData, x as SnapshotMatchOptions, y as SnapshotResult, w as SnapshotStateOptions, G as SnapshotSummary, v as SnapshotUpdateState, S as Suite, m as SuiteAPI, p as SuiteCollector, q as SuiteFactory, o as SuiteHooks, i as Task, f as TaskBase, g as TaskResult, T as TaskResultPack, e as TaskState, h as Test, l as TestAPI, s as TestContext, j as TestFunction, k as TestOptions, z as UncheckedSnapshot, U as UserConfig, a4 as UserConsoleLog, t as Vitest, V as VitestEnvironment, c as VitestRunMode, W as WorkerContext, O as WorkerGlobalState, N as WorkerRPC } from './global-
|
|
1
|
+
import { s as spyOn, f as fn, M as MaybeMockedDeep, a as MaybeMocked, b as MaybePartiallyMocked, c as MaybePartiallyMockedDeep, E as EnhancedSpy } from './index-60e2a8e1.js';
|
|
2
|
+
export { E as EnhancedSpy, r as Mock, u as MockContext, q as MockInstance, v as Mocked, w as MockedClass, o as MockedFunction, p as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, i as it, d as suite, t as test } from './index-60e2a8e1.js';
|
|
3
|
+
import { D as DoneCallback, F as FakeTimerInstallOpts, a as File, T as TaskResultPack, R as ResolvedConfig, M as ModuleGraphData, b as Reporter } from './global-d05ffb3f.js';
|
|
4
|
+
export { L as AfterSuiteRunMeta, A as ApiConfig, Y as ArgumentsType, X as Arrayable, P as Awaitable, ae as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, B as BuiltinEnvironment, C as CSSModuleScopeStrategy, a0 as Constructable, ag as CoverageC8Options, af as CoverageIstanbulOptions, ac as CoverageOptions, a9 as CoverageProvider, aa as CoverageProviderModule, ab as CoverageReporter, _ as DeepMerge, D as DoneCallback, a3 as Environment, E as EnvironmentOptions, a2 as EnvironmentReturn, a7 as ErrorWithDiff, a as File, n as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, Z as MergeInsertions, a1 as ModuleCache, M as ModuleGraphData, $ as MutableArray, Q as Nullable, a8 as OnServerRestartHandler, a6 as ParsedStack, a5 as Position, b as Reporter, K as ResolveIdFunction, R as ResolvedConfig, ad as ResolvedCoverageOptions, d as RunMode, r as RuntimeContext, u as SnapshotData, x as SnapshotMatchOptions, y as SnapshotResult, w as SnapshotStateOptions, G as SnapshotSummary, v as SnapshotUpdateState, S as Suite, m as SuiteAPI, p as SuiteCollector, q as SuiteFactory, o as SuiteHooks, i as Task, f as TaskBase, g as TaskResult, T as TaskResultPack, e as TaskState, h as Test, l as TestAPI, s as TestContext, j as TestFunction, k as TestOptions, z as UncheckedSnapshot, U as UserConfig, a4 as UserConsoleLog, t as Vitest, V as VitestEnvironment, c as VitestRunMode, W as WorkerContext, O as WorkerGlobalState, N as WorkerRPC } from './global-d05ffb3f.js';
|
|
5
5
|
import { TransformResult } from 'vite';
|
|
6
6
|
import * as chai from 'chai';
|
|
7
7
|
export { chai };
|
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { b as bench, c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.
|
|
2
|
-
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, h as getRunningMode, f as isFirstRun, j as isWatchMode, e as runOnce, v as vi, g as vitest, w as withCallback } from './chunk-runtime-hooks.
|
|
1
|
+
export { b as bench, c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.7a7f3c3b.mjs';
|
|
2
|
+
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach, h as getRunningMode, f as isFirstRun, j as isWatchMode, e as runOnce, v as vi, g as vitest, w as withCallback } from './chunk-runtime-hooks.1a0bc3fd.mjs';
|
|
3
3
|
import * as chai from 'chai';
|
|
4
4
|
export { chai };
|
|
5
5
|
export { assert, should } from 'chai';
|
|
6
6
|
import 'util';
|
|
7
|
-
import './chunk-mock-date.
|
|
7
|
+
import './chunk-mock-date.2917be60.mjs';
|
|
8
8
|
import 'path';
|
|
9
|
-
import './chunk-constants.
|
|
9
|
+
import './chunk-constants.71e8a211.mjs';
|
|
10
10
|
import 'tty';
|
|
11
11
|
import 'url';
|
|
12
12
|
import 'local-pkg';
|
|
13
13
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
14
|
-
import './chunk-runtime-rpc.
|
|
14
|
+
import './chunk-runtime-rpc.00a890d2.mjs';
|
|
15
15
|
import './chunk-utils-timers.b48455ed.mjs';
|
|
16
16
|
import 'fs';
|
|
17
|
-
import './chunk-utils-source-map.
|
|
17
|
+
import './chunk-utils-source-map.2be5aa48.mjs';
|
|
18
18
|
import './spy.mjs';
|
|
19
19
|
import 'tinyspy';
|
package/dist/loader.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { pathToFileURL } from 'url';
|
|
2
2
|
import { readFile } from 'fs/promises';
|
|
3
|
-
import { i as isNodeBuiltin, d as normalizeModuleId, h as hasCJSSyntax } from './chunk-vite-node-utils.
|
|
4
|
-
import { g as getWorkerState } from './chunk-mock-date.
|
|
5
|
-
import './chunk-constants.
|
|
3
|
+
import { i as isNodeBuiltin, d as normalizeModuleId, h as hasCJSSyntax } from './chunk-vite-node-utils.473cd0b2.mjs';
|
|
4
|
+
import { g as getWorkerState } from './chunk-mock-date.2917be60.mjs';
|
|
5
|
+
import './chunk-constants.71e8a211.mjs';
|
|
6
6
|
import 'tty';
|
|
7
7
|
import 'path';
|
|
8
8
|
import 'module';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as VitestRunMode, U as UserConfig, t as Vitest, am as ModuleCacheMap, an as ViteNodeRunnerOptions, ao as MockMap, ap as ViteNodeRunner, aq as TestSequencer } from './global-
|
|
2
|
-
export { aq as TestSequencer, as as TestSequencerConstructor, t as Vitest, ar as startVitest } from './global-
|
|
1
|
+
import { c as VitestRunMode, U as UserConfig, t as Vitest, am as ModuleCacheMap, an as ViteNodeRunnerOptions, ao as MockMap, ap as ViteNodeRunner, aq as TestSequencer } from './global-d05ffb3f.js';
|
|
2
|
+
export { aq as TestSequencer, as as TestSequencerConstructor, t as Vitest, ar as startVitest } from './global-d05ffb3f.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, Plugin } from 'vite';
|
|
4
4
|
import 'tinybench';
|
|
5
5
|
import 'fs';
|
package/dist/node.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.
|
|
2
|
-
export { V as VitestRunner } from './chunk-runtime-mocker.
|
|
3
|
-
import './chunk-constants.
|
|
1
|
+
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.f55c4577.mjs';
|
|
2
|
+
export { V as VitestRunner } from './chunk-runtime-mocker.8d4a2494.mjs';
|
|
3
|
+
import './chunk-constants.71e8a211.mjs';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'url';
|
|
6
6
|
import 'path';
|
|
@@ -8,7 +8,7 @@ import './chunk-integrations-coverage.99c020eb.mjs';
|
|
|
8
8
|
import 'local-pkg';
|
|
9
9
|
import './chunk-env-node.ceb43f1c.mjs';
|
|
10
10
|
import 'console';
|
|
11
|
-
import './chunk-mock-date.
|
|
11
|
+
import './chunk-mock-date.2917be60.mjs';
|
|
12
12
|
import 'vite';
|
|
13
13
|
import 'process';
|
|
14
14
|
import 'fs';
|
|
@@ -17,20 +17,20 @@ import 'util';
|
|
|
17
17
|
import 'stream';
|
|
18
18
|
import 'events';
|
|
19
19
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
20
|
-
import './chunk-vite-node-client.
|
|
20
|
+
import './chunk-vite-node-client.da0a17ff.mjs';
|
|
21
21
|
import 'module';
|
|
22
22
|
import 'vm';
|
|
23
|
-
import './chunk-vite-node-utils.
|
|
23
|
+
import './chunk-vite-node-utils.473cd0b2.mjs';
|
|
24
24
|
import 'assert';
|
|
25
25
|
import 'debug';
|
|
26
26
|
import 'perf_hooks';
|
|
27
27
|
import 'worker_threads';
|
|
28
28
|
import 'tinypool';
|
|
29
|
-
import './chunk-utils-source-map.
|
|
29
|
+
import './chunk-utils-source-map.2be5aa48.mjs';
|
|
30
30
|
import './chunk-utils-timers.b48455ed.mjs';
|
|
31
31
|
import 'crypto';
|
|
32
|
-
import './vendor-index.
|
|
33
|
-
import './vendor-index.
|
|
32
|
+
import './vendor-index.9d9196cc.mjs';
|
|
33
|
+
import './vendor-index.29636037.mjs';
|
|
34
34
|
import './chunk-magic-string.56b2b543.mjs';
|
|
35
35
|
import 'strip-literal';
|
|
36
36
|
import 'readline';
|
package/dist/suite.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import 'util';
|
|
2
|
-
import './chunk-mock-date.
|
|
3
|
-
export { b as bench, f as clearCollectorContext,
|
|
2
|
+
import './chunk-mock-date.2917be60.mjs';
|
|
3
|
+
export { b as bench, f as clearCollectorContext, p as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.7a7f3c3b.mjs';
|
|
4
4
|
import 'path';
|
|
5
|
-
import './chunk-constants.
|
|
5
|
+
import './chunk-constants.71e8a211.mjs';
|
|
6
6
|
import 'tty';
|
|
7
7
|
import 'url';
|
|
8
8
|
import 'local-pkg';
|
|
9
9
|
import 'chai';
|
|
10
10
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
11
|
-
import './chunk-runtime-rpc.
|
|
11
|
+
import './chunk-runtime-rpc.00a890d2.mjs';
|
|
12
12
|
import './chunk-utils-timers.b48455ed.mjs';
|
|
13
13
|
import 'fs';
|
|
14
|
-
import './chunk-utils-source-map.
|
|
14
|
+
import './chunk-utils-source-map.2be5aa48.mjs';
|
|
15
15
|
import './spy.mjs';
|
|
16
16
|
import 'tinyspy';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,10 +2,10 @@ import { Buffer } from 'buffer';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import childProcess from 'child_process';
|
|
4
4
|
import process$1 from 'process';
|
|
5
|
-
import { m as mergeStream, g as getStream, c as crossSpawn } from './vendor-index.
|
|
5
|
+
import { m as mergeStream, g as getStream, c as crossSpawn } from './vendor-index.2ae8040a.mjs';
|
|
6
6
|
import url from 'url';
|
|
7
7
|
import require$$0, { constants } from 'os';
|
|
8
|
-
import { s as signalExit } from './vendor-index.
|
|
8
|
+
import { s as signalExit } from './vendor-index.29636037.mjs';
|
|
9
9
|
|
|
10
10
|
function stripFinalNewline(input) {
|
|
11
11
|
const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
|
package/dist/worker.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { a as resolve, c as distDir } from './chunk-constants.
|
|
2
|
-
import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-client.
|
|
1
|
+
import { a as resolve, c as distDir } from './chunk-constants.71e8a211.mjs';
|
|
2
|
+
import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-client.da0a17ff.mjs';
|
|
3
3
|
import { workerId } from 'tinypool';
|
|
4
|
-
import { g as getWorkerState } from './chunk-mock-date.
|
|
5
|
-
import { e as executeInViteNode } from './chunk-runtime-mocker.
|
|
6
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
4
|
+
import { g as getWorkerState } from './chunk-mock-date.2917be60.mjs';
|
|
5
|
+
import { e as executeInViteNode } from './chunk-runtime-mocker.8d4a2494.mjs';
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.00a890d2.mjs';
|
|
7
7
|
import 'tty';
|
|
8
8
|
import 'url';
|
|
9
9
|
import 'path';
|
|
10
10
|
import 'module';
|
|
11
11
|
import 'vm';
|
|
12
|
-
import './chunk-vite-node-utils.
|
|
12
|
+
import './chunk-vite-node-utils.473cd0b2.mjs';
|
|
13
13
|
import 'fs';
|
|
14
14
|
import 'assert';
|
|
15
15
|
import 'util';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
"debug": "^4.3.4",
|
|
99
99
|
"local-pkg": "^0.4.2",
|
|
100
100
|
"strip-literal": "^0.4.0",
|
|
101
|
-
"tinybench": "^2.1.
|
|
102
|
-
"tinypool": "^0.
|
|
101
|
+
"tinybench": "^2.1.5",
|
|
102
|
+
"tinypool": "^0.3.0",
|
|
103
103
|
"tinyspy": "^1.0.2",
|
|
104
104
|
"vite": "^2.9.12 || ^3.0.0-0"
|
|
105
105
|
},
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"@types/natural-compare": "^1.4.1",
|
|
114
114
|
"@types/prompts": "^2.4.0",
|
|
115
115
|
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
116
|
-
"@vitest/ui": "0.23.
|
|
116
|
+
"@vitest/ui": "0.23.2",
|
|
117
117
|
"birpc": "^0.2.3",
|
|
118
118
|
"cac": "^6.7.14",
|
|
119
119
|
"chai-subset": "^1.6.0",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"happy-dom": "^6.0.4",
|
|
128
128
|
"jsdom": "^20.0.0",
|
|
129
129
|
"log-update": "^5.0.1",
|
|
130
|
-
"magic-string": "^0.26.
|
|
130
|
+
"magic-string": "^0.26.3",
|
|
131
131
|
"micromatch": "^4.0.5",
|
|
132
132
|
"mlly": "^0.5.14",
|
|
133
133
|
"natural-compare": "^1.4.0",
|
|
@@ -137,15 +137,15 @@
|
|
|
137
137
|
"pkg-types": "^0.3.4",
|
|
138
138
|
"pretty-format": "^27.5.1",
|
|
139
139
|
"prompts": "^2.4.2",
|
|
140
|
-
"rollup": "^2.
|
|
140
|
+
"rollup": "^2.79.0",
|
|
141
141
|
"source-map-js": "^1.0.2",
|
|
142
142
|
"strip-ansi": "^7.0.1",
|
|
143
143
|
"typescript": "^4.8.2",
|
|
144
|
-
"vite-node": "0.23.
|
|
144
|
+
"vite-node": "0.23.2",
|
|
145
145
|
"ws": "^8.8.1"
|
|
146
146
|
},
|
|
147
147
|
"scripts": {
|
|
148
148
|
"build": "rimraf dist && rollup -c",
|
|
149
|
-
"dev": "NODE_OPTIONS=\"--max-old-space-size=8192\" rollup -c --watch -m inline"
|
|
149
|
+
"dev": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" rollup -c --watch -m inline"
|
|
150
150
|
}
|
|
151
151
|
}
|