vitest 0.25.4 → 0.25.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +7 -7
- package/dist/{chunk-api-setup.1c8923c4.js → chunk-api-setup.995f6ab7.js} +2 -2
- package/dist/{chunk-integrations-globals.789c69e2.js → chunk-integrations-globals.57158eb5.js} +4 -4
- package/dist/{chunk-runtime-chain.315721df.js → chunk-runtime-chain.dd978482.js} +2 -2
- package/dist/{chunk-runtime-error.95c286d7.js → chunk-runtime-error.616e92ca.js} +1 -1
- package/dist/{chunk-runtime-mocker.cdc0ec57.js → chunk-runtime-mocker.34e72575.js} +2 -2
- package/dist/{chunk-runtime-rpc.b368762d.js → chunk-runtime-rpc.42aebbb9.js} +1 -1
- package/dist/{chunk-runtime-setup.80b27439.js → chunk-runtime-setup.bd2deed4.js} +10 -10
- package/dist/{chunk-runtime-test-state.7c288e2d.js → chunk-runtime-test-state.0037e2e0.js} +2 -2
- package/dist/{chunk-utils-timers.b81cda77.js → chunk-utils-timers.793fd179.js} +0 -0
- package/dist/{chunk-vite-node-externalize.ddcbafa3.js → chunk-vite-node-externalize.ca4784be.js} +25 -13
- package/dist/{chunk-vite-node-source-map.61c5ea66.js → chunk-vite-node-source-map.d0aa773d.js} +30 -18
- package/dist/{chunk-vite-node-utils.abe05c5c.js → chunk-vite-node-utils.9047cb87.js} +4 -1
- package/dist/cli.js +4 -4
- package/dist/config.d.ts +1 -1
- package/dist/entry.js +6 -6
- package/dist/environments.d.ts +1 -1
- package/dist/{index-81973d31.d.ts → index-2f15c9a8.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -5
- package/dist/loader.js +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.js +5 -5
- package/dist/suite.js +3 -3
- package/dist/{types-1cf24598.d.ts → types-79a05dee.d.ts} +2 -0
- package/dist/worker.js +6 -6
- package/package.json +3 -3
package/dist/browser.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-
|
|
2
|
-
import { b as ResolvedConfig } from './types-
|
|
3
|
-
export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-
|
|
1
|
+
export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-2f15c9a8.js';
|
|
2
|
+
import { b as ResolvedConfig } from './types-79a05dee.js';
|
|
3
|
+
export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-79a05dee.js';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
package/dist/browser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
import { e as dist } from './chunk-runtime-test-state.
|
|
3
|
-
export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-runtime-test-state.
|
|
4
|
-
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.
|
|
1
|
+
export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.dd978482.js';
|
|
2
|
+
import { e as dist } from './chunk-runtime-test-state.0037e2e0.js';
|
|
3
|
+
export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-runtime-test-state.0037e2e0.js';
|
|
4
|
+
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.bd2deed4.js';
|
|
5
5
|
import * as chai from 'chai';
|
|
6
6
|
export { chai };
|
|
7
7
|
export { assert, should } from 'chai';
|
|
@@ -13,15 +13,15 @@ import 'tty';
|
|
|
13
13
|
import 'url';
|
|
14
14
|
import 'local-pkg';
|
|
15
15
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
16
|
-
import './chunk-runtime-rpc.
|
|
17
|
-
import './chunk-utils-timers.
|
|
16
|
+
import './chunk-runtime-rpc.42aebbb9.js';
|
|
17
|
+
import './chunk-utils-timers.793fd179.js';
|
|
18
18
|
import 'fs';
|
|
19
19
|
import './chunk-utils-source-map.29ff1088.js';
|
|
20
20
|
import './spy.js';
|
|
21
21
|
import 'tinyspy';
|
|
22
22
|
import 'perf_hooks';
|
|
23
23
|
import './chunk-integrations-coverage.befed097.js';
|
|
24
|
-
import './chunk-runtime-error.
|
|
24
|
+
import './chunk-runtime-error.616e92ca.js';
|
|
25
25
|
import './vendor-source-map-support.1ce17397.js';
|
|
26
26
|
import 'source-map';
|
|
27
27
|
import './chunk-env-node.67948209.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import { c as createBirpc } from './chunk-vite-node-source-map.
|
|
2
|
+
import { c as createBirpc } from './chunk-vite-node-source-map.d0aa773d.js';
|
|
3
3
|
import require$$0$1 from 'stream';
|
|
4
4
|
import require$$0 from 'zlib';
|
|
5
5
|
import require$$3 from 'net';
|
|
@@ -12,7 +12,7 @@ import url from 'url';
|
|
|
12
12
|
import { A as API_PATH } from './chunk-utils-env.03f840f2.js';
|
|
13
13
|
import 'module';
|
|
14
14
|
import 'vm';
|
|
15
|
-
import './chunk-vite-node-utils.
|
|
15
|
+
import './chunk-vite-node-utils.9047cb87.js';
|
|
16
16
|
import 'acorn';
|
|
17
17
|
import 'path';
|
|
18
18
|
import 'assert';
|
package/dist/{chunk-integrations-globals.789c69e2.js → chunk-integrations-globals.57158eb5.js}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { m as globalApis } from './chunk-utils-env.03f840f2.js';
|
|
2
|
-
import { i as index } from './chunk-runtime-test-state.
|
|
2
|
+
import { i as index } from './chunk-runtime-test-state.0037e2e0.js';
|
|
3
3
|
import 'tty';
|
|
4
4
|
import 'url';
|
|
5
5
|
import 'path';
|
|
6
|
-
import './chunk-runtime-chain.
|
|
6
|
+
import './chunk-runtime-chain.dd978482.js';
|
|
7
7
|
import 'util';
|
|
8
8
|
import 'chai';
|
|
9
9
|
import './chunk-typecheck-constants.ed987901.js';
|
|
10
10
|
import 'local-pkg';
|
|
11
11
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
12
|
-
import './chunk-runtime-rpc.
|
|
13
|
-
import './chunk-utils-timers.
|
|
12
|
+
import './chunk-runtime-rpc.42aebbb9.js';
|
|
13
|
+
import './chunk-utils-timers.793fd179.js';
|
|
14
14
|
import 'fs';
|
|
15
15
|
import './chunk-utils-source-map.29ff1088.js';
|
|
16
16
|
import './spy.js';
|
|
@@ -3,10 +3,10 @@ import * as chai$2 from 'chai';
|
|
|
3
3
|
import { expect, AssertionError, util } from 'chai';
|
|
4
4
|
import { i as isObject, b as getCallLastIndex, s as slash, g as getWorkerState, c as getNames, d as assertTypes, e as getFullName, o as objectAttr, n as noop, f as isRunningInTest, h as isRunningInBenchmark } from './chunk-typecheck-constants.ed987901.js';
|
|
5
5
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
|
|
6
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.42aebbb9.js';
|
|
7
7
|
import fs, { promises } from 'fs';
|
|
8
8
|
import { j as join, d as dirname, p as picocolors } from './chunk-utils-env.03f840f2.js';
|
|
9
|
-
import { p as plugins_1, f as format_1, u as unifiedDiff, a as stringify, m as matcherUtils, s as safeSetTimeout, b as safeClearTimeout } from './chunk-utils-timers.
|
|
9
|
+
import { p as plugins_1, f as format_1, u as unifiedDiff, a as stringify, m as matcherUtils, s as safeSetTimeout, b as safeClearTimeout } from './chunk-utils-timers.793fd179.js';
|
|
10
10
|
import { a as posToNumber, n as numberToPos, l as lineSplitRE, p as parseStacktrace } from './chunk-utils-source-map.29ff1088.js';
|
|
11
11
|
import { isMockFunction } from './spy.js';
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import util$1 from 'util';
|
|
2
2
|
import { util } from 'chai';
|
|
3
|
-
import { a as stringify } from './chunk-utils-timers.
|
|
3
|
+
import { a as stringify } from './chunk-utils-timers.793fd179.js';
|
|
4
4
|
import { w as deepClone, x as getType } from './chunk-typecheck-constants.ed987901.js';
|
|
5
5
|
|
|
6
6
|
const IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { V as ViteNodeRunner } from './chunk-vite-node-source-map.
|
|
1
|
+
import { V as ViteNodeRunner } from './chunk-vite-node-source-map.d0aa773d.js';
|
|
2
2
|
import { normalizePath } from 'vite';
|
|
3
3
|
import { g as getWorkerState, J as mergeSlashes, s as slash, x as getType, K as getAllMockableProperties } from './chunk-typecheck-constants.ed987901.js';
|
|
4
4
|
import { existsSync, readdirSync } from 'fs';
|
|
5
|
-
import {
|
|
5
|
+
import { d as normalizeRequestId, p as pathFromRoot, i as isNodeBuiltin } from './chunk-vite-node-utils.9047cb87.js';
|
|
6
6
|
import { p as picocolors, d as dirname, j as join, c as basename, l as extname, b as resolve, e as distDir } from './chunk-utils-env.03f840f2.js';
|
|
7
7
|
|
|
8
8
|
class RefTracker {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getWorkerState } from './chunk-typecheck-constants.ed987901.js';
|
|
2
|
-
import { s as safeSetTimeout } from './chunk-utils-timers.
|
|
2
|
+
import { s as safeSetTimeout } from './chunk-utils-timers.793fd179.js';
|
|
3
3
|
|
|
4
4
|
const safeRandom = Math.random;
|
|
5
5
|
function withSafeTimers(fn) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { performance } from 'perf_hooks';
|
|
2
2
|
import { s as someTasksAreOnly, i as interpretTaskModes, t as takeCoverageInsideWorker, p as pLimit } from './chunk-integrations-coverage.befed097.js';
|
|
3
|
-
import { r as resetRunOnceCounter, i as index, v as vi, s as setCurrentTest } from './chunk-runtime-test-state.
|
|
3
|
+
import { r as resetRunOnceCounter, i as index, v as vi, s as setCurrentTest } from './chunk-runtime-test-state.0037e2e0.js';
|
|
4
4
|
import { g as getWorkerState, R as RealDate, t as toArray, k as relativePath, h as isRunningInBenchmark, p as partitionSuiteChildren, l as shuffle, q as hasTests, u as hasFailed, v as createDefer, e as getFullName } from './chunk-typecheck-constants.ed987901.js';
|
|
5
|
-
import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as getBenchOptions, n as getFn, o as setState, G as GLOBAL_EXPECT, p as getState } from './chunk-runtime-chain.
|
|
6
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
7
|
-
import { p as processError } from './chunk-runtime-error.
|
|
5
|
+
import { f as clearCollectorContext, h as defaultSuite, j as setHooks, k as getHooks, l as collectorContext, m as getBenchOptions, n as getFn, o as setState, G as GLOBAL_EXPECT, p as getState } from './chunk-runtime-chain.dd978482.js';
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.42aebbb9.js';
|
|
7
|
+
import { p as processError } from './chunk-runtime-error.616e92ca.js';
|
|
8
8
|
import { s as sourceMapSupport } from './vendor-source-map-support.1ce17397.js';
|
|
9
9
|
import { e as environments } from './chunk-env-node.67948209.js';
|
|
10
10
|
import { i as isNode, a as isBrowser } from './chunk-utils-env.03f840f2.js';
|
|
11
|
-
import { b as safeClearTimeout, s as safeSetTimeout } from './chunk-utils-timers.
|
|
11
|
+
import { b as safeClearTimeout, s as safeSetTimeout } from './chunk-utils-timers.793fd179.js';
|
|
12
12
|
|
|
13
13
|
function installSourcemapsSupport(options) {
|
|
14
14
|
sourceMapSupport.exports.install({
|
|
@@ -46,7 +46,7 @@ async function setupGlobalEnv(config) {
|
|
|
46
46
|
await setupConsoleLogSpy();
|
|
47
47
|
}
|
|
48
48
|
if (config.globals)
|
|
49
|
-
(await import('./chunk-integrations-globals.
|
|
49
|
+
(await import('./chunk-integrations-globals.57158eb5.js')).registerApiGlobally();
|
|
50
50
|
}
|
|
51
51
|
function setupDefines(defines) {
|
|
52
52
|
for (const key in defines)
|
|
@@ -346,7 +346,7 @@ const callCleanupHooks = async (cleanups) => {
|
|
|
346
346
|
async function runTest(test) {
|
|
347
347
|
var _a, _b, _c;
|
|
348
348
|
if (test.mode !== "run") {
|
|
349
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
349
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.dd978482.js').then(function (n) { return n.r; });
|
|
350
350
|
getSnapshotClient().skipTestSnapshots(test);
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
@@ -363,7 +363,7 @@ async function runTest(test) {
|
|
|
363
363
|
clearModuleMocks();
|
|
364
364
|
setCurrentTest(test);
|
|
365
365
|
if (isNode) {
|
|
366
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
366
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.dd978482.js').then(function (n) { return n.r; });
|
|
367
367
|
await getSnapshotClient().setTest(test);
|
|
368
368
|
}
|
|
369
369
|
const workerState = getWorkerState();
|
|
@@ -426,7 +426,7 @@ async function runTest(test) {
|
|
|
426
426
|
console.error(test.result.error.message, test.result.error.stackStr);
|
|
427
427
|
setCurrentTest(void 0);
|
|
428
428
|
if (isNode) {
|
|
429
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
429
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.dd978482.js').then(function (n) { return n.r; });
|
|
430
430
|
getSnapshotClient().clearTest();
|
|
431
431
|
}
|
|
432
432
|
test.result.duration = now() - start;
|
|
@@ -632,7 +632,7 @@ async function startTestsBrowser(paths, config) {
|
|
|
632
632
|
async function startTestsNode(paths, config) {
|
|
633
633
|
const files = await collectTests(paths, config);
|
|
634
634
|
rpc().onCollected(files);
|
|
635
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
635
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.dd978482.js').then(function (n) { return n.r; });
|
|
636
636
|
getSnapshotClient().clear();
|
|
637
637
|
await runFiles(files, config);
|
|
638
638
|
const coverage = await takeCoverageInsideWorker(config.coverage);
|
|
@@ -1,10 +1,10 @@
|
|
|
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.
|
|
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.dd978482.js';
|
|
2
2
|
import { g as getWorkerState, R as RealDate, r as resetDate, m as mockDate, a as resetModules } from './chunk-typecheck-constants.ed987901.js';
|
|
3
3
|
import { p as parseStacktrace } from './chunk-utils-source-map.29ff1088.js';
|
|
4
4
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
|
|
5
5
|
import util from 'util';
|
|
6
6
|
import { spyOn, fn, isMockFunction, spies } from './spy.js';
|
|
7
|
-
import { s as safeSetTimeout } from './chunk-utils-timers.
|
|
7
|
+
import { s as safeSetTimeout } from './chunk-utils-timers.793fd179.js';
|
|
8
8
|
import * as chai from 'chai';
|
|
9
9
|
import { assert, should } from 'chai';
|
|
10
10
|
|
|
File without changes
|
package/dist/{chunk-vite-node-externalize.ddcbafa3.js → chunk-vite-node-externalize.ca4784be.js}
RENAMED
|
@@ -12,10 +12,10 @@ 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.addc3445.js';
|
|
15
|
-
import { w as withInlineSourcemap, c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-source-map.
|
|
15
|
+
import { w as withInlineSourcemap, c as createBirpc, V as ViteNodeRunner } from './chunk-vite-node-source-map.d0aa773d.js';
|
|
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 } from './chunk-vite-node-utils.
|
|
18
|
+
import { i as isNodeBuiltin, a as isValidNodeImport, s as slash$1, t as toArray, n as normalizeModuleId, b as toFilePath, c as cleanUrl } from './chunk-vite-node-utils.9047cb87.js';
|
|
19
19
|
import { writeFile, rm } from 'fs/promises';
|
|
20
20
|
import { e as execa } from './vendor-index.737c3cff.js';
|
|
21
21
|
import { SourceMapConsumer } from 'source-map';
|
|
@@ -24,7 +24,7 @@ import { parse as parse$4 } from 'acorn';
|
|
|
24
24
|
import { ancestor } from 'acorn-walk';
|
|
25
25
|
import { MessageChannel } from 'worker_threads';
|
|
26
26
|
import { Tinypool } from 'tinypool';
|
|
27
|
-
import { c as stripAnsi, d as safeSetInterval, e as safeClearInterval, g as cliTruncate, s as safeSetTimeout, h as stringWidth, i as ansiStyles, j as sliceAnsi, a as stringify$5, u as unifiedDiff, b as safeClearTimeout } from './chunk-utils-timers.
|
|
27
|
+
import { c as stripAnsi, d as safeSetInterval, e as safeClearInterval, g as cliTruncate, s as safeSetTimeout, h as stringWidth, i as ansiStyles, j as sliceAnsi, a as stringify$5, u as unifiedDiff, b as safeClearTimeout } from './chunk-utils-timers.793fd179.js';
|
|
28
28
|
import { p as parseStacktrace, a as posToNumber, l as lineSplitRE } from './chunk-utils-source-map.29ff1088.js';
|
|
29
29
|
import { resolveModule } from 'local-pkg';
|
|
30
30
|
import { createHash } from 'crypto';
|
|
@@ -35,7 +35,7 @@ import { stripLiteral } from 'strip-literal';
|
|
|
35
35
|
import require$$0$2 from 'readline';
|
|
36
36
|
import { p as prompts } from './vendor-index.9f20a9be.js';
|
|
37
37
|
|
|
38
|
-
var version$1 = "0.25.
|
|
38
|
+
var version$1 = "0.25.5";
|
|
39
39
|
|
|
40
40
|
class EndError extends Error {
|
|
41
41
|
constructor(value) {
|
|
@@ -6937,7 +6937,6 @@ ${result.code}`, "utf-8");
|
|
|
6937
6937
|
}
|
|
6938
6938
|
|
|
6939
6939
|
const debugRequest = createDebug("vite-node:server:request");
|
|
6940
|
-
const RealDate = Date;
|
|
6941
6940
|
class ViteNodeServer {
|
|
6942
6941
|
constructor(server, options = {}) {
|
|
6943
6942
|
this.server = server;
|
|
@@ -6984,6 +6983,7 @@ class ViteNodeServer {
|
|
|
6984
6983
|
return (ssrTransformResult == null ? void 0 : ssrTransformResult.map) || null;
|
|
6985
6984
|
}
|
|
6986
6985
|
async fetchModule(id) {
|
|
6986
|
+
id = normalizeModuleId(id);
|
|
6987
6987
|
if (!this.fetchPromiseMap.has(id)) {
|
|
6988
6988
|
this.fetchPromiseMap.set(
|
|
6989
6989
|
id,
|
|
@@ -7023,24 +7023,33 @@ class ViteNodeServer {
|
|
|
7023
7023
|
let result;
|
|
7024
7024
|
const filePath = toFilePath(id, this.server.config.root);
|
|
7025
7025
|
const module = this.server.moduleGraph.getModuleById(id);
|
|
7026
|
-
const timestamp =
|
|
7026
|
+
const timestamp = module ? module.lastHMRTimestamp : null;
|
|
7027
7027
|
const cache = this.fetchCache.get(filePath);
|
|
7028
|
-
if (
|
|
7028
|
+
if (cache == null ? void 0 : cache.result.id)
|
|
7029
|
+
id = cache.result.id;
|
|
7030
|
+
if (timestamp !== null && cache && cache.timestamp >= timestamp)
|
|
7029
7031
|
return cache.result;
|
|
7032
|
+
const time = Date.now();
|
|
7030
7033
|
const externalize = await this.shouldExternalize(filePath);
|
|
7031
7034
|
let duration;
|
|
7032
7035
|
if (externalize) {
|
|
7033
7036
|
result = { externalize };
|
|
7034
7037
|
(_a = this.debugger) == null ? void 0 : _a.recordExternalize(id, externalize);
|
|
7035
7038
|
} else {
|
|
7039
|
+
let file = module == null ? void 0 : module.file;
|
|
7040
|
+
if (!file) {
|
|
7041
|
+
const [, resolvedId] = await this.server.moduleGraph.resolveUrl(id, true);
|
|
7042
|
+
id = resolvedId;
|
|
7043
|
+
file = cleanUrl(resolvedId);
|
|
7044
|
+
}
|
|
7036
7045
|
const start = performance.now();
|
|
7037
7046
|
const r = await this._transformRequest(id);
|
|
7038
7047
|
duration = performance.now() - start;
|
|
7039
|
-
result = { code: r == null ? void 0 : r.code, map: r == null ? void 0 : r.map };
|
|
7048
|
+
result = { file, id, code: r == null ? void 0 : r.code, map: r == null ? void 0 : r.map };
|
|
7040
7049
|
}
|
|
7041
7050
|
this.fetchCache.set(filePath, {
|
|
7042
7051
|
duration,
|
|
7043
|
-
timestamp,
|
|
7052
|
+
timestamp: time,
|
|
7044
7053
|
result
|
|
7045
7054
|
});
|
|
7046
7055
|
return result;
|
|
@@ -10206,7 +10215,7 @@ createLogUpdate(process$1.stdout);
|
|
|
10206
10215
|
|
|
10207
10216
|
createLogUpdate(process$1.stderr);
|
|
10208
10217
|
|
|
10209
|
-
var version = "0.25.
|
|
10218
|
+
var version = "0.25.5";
|
|
10210
10219
|
|
|
10211
10220
|
function fileFromParsedStack(stack) {
|
|
10212
10221
|
var _a, _b;
|
|
@@ -10568,8 +10577,7 @@ class Vitest {
|
|
|
10568
10577
|
this.cache.results.setConfig(resolved.root, resolved.cache);
|
|
10569
10578
|
try {
|
|
10570
10579
|
await this.cache.results.readFromCache();
|
|
10571
|
-
} catch
|
|
10572
|
-
this.logger.error(`[vitest] Error, while trying to parse cache in ${this.cache.results.getCachePath()}:`, err);
|
|
10580
|
+
} catch {
|
|
10573
10581
|
}
|
|
10574
10582
|
}
|
|
10575
10583
|
async initCoverageProvider() {
|
|
@@ -10732,6 +10740,7 @@ class Vitest {
|
|
|
10732
10740
|
return runningTests;
|
|
10733
10741
|
}
|
|
10734
10742
|
async runFiles(paths) {
|
|
10743
|
+
paths = Array.from(new Set(paths));
|
|
10735
10744
|
await this.runningPromise;
|
|
10736
10745
|
this.state.startCollectingPaths();
|
|
10737
10746
|
this.runningPromise = (async () => {
|
|
@@ -10796,6 +10805,9 @@ class Vitest {
|
|
|
10796
10805
|
}
|
|
10797
10806
|
}
|
|
10798
10807
|
async scheduleRerun(triggerId) {
|
|
10808
|
+
const mod = this.server.moduleGraph.getModuleById(triggerId);
|
|
10809
|
+
if (mod)
|
|
10810
|
+
mod.lastHMRTimestamp = Date.now();
|
|
10799
10811
|
const currentCount = this.restartsCount;
|
|
10800
10812
|
safeClearTimeout(this._rerunTimer);
|
|
10801
10813
|
await this.runningPromise;
|
|
@@ -11382,7 +11394,7 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
|
|
|
11382
11394
|
try {
|
|
11383
11395
|
await ctx.setServer(options, server);
|
|
11384
11396
|
if (options.api && options.watch)
|
|
11385
|
-
(await import('./chunk-api-setup.
|
|
11397
|
+
(await import('./chunk-api-setup.995f6ab7.js')).setup(ctx);
|
|
11386
11398
|
} catch (err) {
|
|
11387
11399
|
ctx.logger.printError(err, true);
|
|
11388
11400
|
process.exit(1);
|
package/dist/{chunk-vite-node-source-map.61c5ea66.js → chunk-vite-node-source-map.d0aa773d.js}
RENAMED
|
@@ -2,24 +2,28 @@ import { createRequire } from 'module';
|
|
|
2
2
|
import { pathToFileURL, fileURLToPath } from 'url';
|
|
3
3
|
import vm from 'vm';
|
|
4
4
|
import { b as resolve, d as dirname, g as isAbsolute, l as extname } from './chunk-utils-env.03f840f2.js';
|
|
5
|
-
import { s as slash,
|
|
5
|
+
import { s as slash, d as normalizeRequestId, b as toFilePath, e as isPrimitive, i as isNodeBuiltin, n as normalizeModuleId, m as mergeSlashes } from './chunk-vite-node-utils.9047cb87.js';
|
|
6
6
|
import createDebug from 'debug';
|
|
7
7
|
import './vendor-source-map-support.1ce17397.js';
|
|
8
8
|
|
|
9
9
|
let SOURCEMAPPING_URL = "sourceMa";
|
|
10
10
|
SOURCEMAPPING_URL += "ppingURL";
|
|
11
|
-
const
|
|
11
|
+
const VITE_NODE_SOURCEMAPPING_SOURCE = "//# sourceMappingSource=vite-node";
|
|
12
|
+
const VITE_NODE_SOURCEMAPPING_URL = `${SOURCEMAPPING_URL}=data:application/json;charset=utf-8`;
|
|
12
13
|
const VITE_NODE_SOURCEMAPPING_REGEXP = new RegExp(`//# ${VITE_NODE_SOURCEMAPPING_URL};base64,(.+)`);
|
|
13
|
-
const OTHER_SOURCE_MAP_REGEXP = new RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json[^,]+base64,(.+)`);
|
|
14
14
|
async function withInlineSourcemap(result) {
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const map = result.map;
|
|
16
|
+
let code = result.code;
|
|
17
|
+
if (!map || code.includes(VITE_NODE_SOURCEMAPPING_SOURCE))
|
|
17
18
|
return result;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const OTHER_SOURCE_MAP_REGEXP = new RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json[^,]+base64,(.+)`, "g");
|
|
20
|
+
while (OTHER_SOURCE_MAP_REGEXP.test(code))
|
|
21
|
+
code = code.replace(OTHER_SOURCE_MAP_REGEXP, "");
|
|
22
|
+
const sourceMap = Buffer.from(JSON.stringify(map), "utf-8").toString("base64");
|
|
23
|
+
result.code = `${code.trimEnd()}
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
${VITE_NODE_SOURCEMAPPING_SOURCE}
|
|
26
|
+
//# ${VITE_NODE_SOURCEMAPPING_URL};base64,${sourceMap}
|
|
23
27
|
`;
|
|
24
28
|
return result;
|
|
25
29
|
}
|
|
@@ -171,7 +175,7 @@ class ViteNodeRunner {
|
|
|
171
175
|
}
|
|
172
176
|
async directRequest(id, fsPath, _callstack) {
|
|
173
177
|
const callstack = [..._callstack, fsPath];
|
|
174
|
-
|
|
178
|
+
let mod = this.moduleCache.get(fsPath);
|
|
175
179
|
const request = async (dep) => {
|
|
176
180
|
var _a;
|
|
177
181
|
const depFsPath = toFilePath(normalizeRequestId(dep, this.options.base), this.root);
|
|
@@ -207,11 +211,22 @@ ${getStack()}`), 2e3);
|
|
|
207
211
|
}
|
|
208
212
|
return dep;
|
|
209
213
|
};
|
|
210
|
-
id = await resolveId(id, 2);
|
|
211
214
|
const requestStubs = this.options.requestStubs || DEFAULT_REQUEST_STUBS;
|
|
212
215
|
if (id in requestStubs)
|
|
213
216
|
return requestStubs[id];
|
|
214
|
-
let { code: transformed, externalize } = await this.options.fetchModule(id);
|
|
217
|
+
let { code: transformed, externalize, file } = await this.options.fetchModule(id);
|
|
218
|
+
if (file && !fsPath.includes("?") && fsPath !== file) {
|
|
219
|
+
if (this.moduleCache.has(file)) {
|
|
220
|
+
mod = this.moduleCache.get(file);
|
|
221
|
+
this.moduleCache.set(fsPath, mod);
|
|
222
|
+
if (mod.promise)
|
|
223
|
+
return mod.promise;
|
|
224
|
+
if (mod.exports)
|
|
225
|
+
return mod.exports;
|
|
226
|
+
} else {
|
|
227
|
+
this.moduleCache.set(file, mod);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
215
230
|
if (externalize) {
|
|
216
231
|
debugNative(externalize);
|
|
217
232
|
const exports2 = await this.interopedImport(externalize);
|
|
@@ -220,7 +235,7 @@ ${getStack()}`), 2e3);
|
|
|
220
235
|
}
|
|
221
236
|
if (transformed == null)
|
|
222
237
|
throw new Error(`[vite-node] Failed to load ${id}`);
|
|
223
|
-
const url = pathToFileURL(fsPath).href;
|
|
238
|
+
const url = pathToFileURL(file || fsPath).href;
|
|
224
239
|
const meta = { url };
|
|
225
240
|
const exports = /* @__PURE__ */ Object.create(null);
|
|
226
241
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
@@ -229,9 +244,6 @@ ${getStack()}`), 2e3);
|
|
|
229
244
|
configurable: false
|
|
230
245
|
});
|
|
231
246
|
const cjsExports = new Proxy(exports, {
|
|
232
|
-
get(_, p, receiver) {
|
|
233
|
-
return Reflect.get(exports, p, receiver);
|
|
234
|
-
},
|
|
235
247
|
set(_, p, value) {
|
|
236
248
|
if (!Reflect.has(exports, "default"))
|
|
237
249
|
exports.default = {};
|
|
@@ -245,7 +257,7 @@ ${getStack()}`), 2e3);
|
|
|
245
257
|
return true;
|
|
246
258
|
}
|
|
247
259
|
});
|
|
248
|
-
Object.assign(mod, { code: transformed, exports
|
|
260
|
+
Object.assign(mod, { code: transformed, exports });
|
|
249
261
|
const __filename = fileURLToPath(url);
|
|
250
262
|
const moduleProxy = {
|
|
251
263
|
set exports(value) {
|
|
@@ -287,7 +299,7 @@ ${getStack()}`), 2e3);
|
|
|
287
299
|
const code = `${codeDefinition}${transformed}
|
|
288
300
|
}}`;
|
|
289
301
|
const fn = vm.runInThisContext(code, {
|
|
290
|
-
filename:
|
|
302
|
+
filename: __filename,
|
|
291
303
|
lineOffset: 0,
|
|
292
304
|
columnOffset: -codeDefinition.length
|
|
293
305
|
});
|
|
@@ -1342,6 +1342,9 @@ function normalizeRequestId(id, base) {
|
|
|
1342
1342
|
id = `/${id.slice(base.length)}`;
|
|
1343
1343
|
return id.replace(/^\/@id\/__x00__/, "\0").replace(/^\/@id\//, "").replace(/^__vite-browser-external:/, "").replace(/^(node|file):/, "").replace(/^\/+/, "/").replace(/\?v=\w+/, "?").replace(/&v=\w+/, "").replace(/\?t=\w+/, "?").replace(/&t=\w+/, "").replace(/\?import/, "?").replace(/&import/, "").replace(/\?&/, "?").replace(/\?+$/, "");
|
|
1344
1344
|
}
|
|
1345
|
+
const queryRE = /\?.*$/s;
|
|
1346
|
+
const hashRE = /#.*$/s;
|
|
1347
|
+
const cleanUrl = (url) => url.replace(hashRE, "").replace(queryRE, "");
|
|
1345
1348
|
function normalizeModuleId(id) {
|
|
1346
1349
|
return id.replace(/\\/g, "/").replace(/^\/@fs\//, "/").replace(/^file:\//, "/").replace(/^\/+/, "/");
|
|
1347
1350
|
}
|
|
@@ -1382,4 +1385,4 @@ function toArray(array) {
|
|
|
1382
1385
|
return [array];
|
|
1383
1386
|
}
|
|
1384
1387
|
|
|
1385
|
-
export { isValidNodeImport as a, toFilePath as b,
|
|
1388
|
+
export { isValidNodeImport as a, toFilePath as b, cleanUrl as c, normalizeRequestId as d, isPrimitive as e, hasCJSSyntax as h, isNodeBuiltin as i, mergeSlashes as m, normalizeModuleId as n, pathFromRoot as p, slash as s, toArray as t };
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as picocolors, n as normalize } from './chunk-utils-env.03f840f2.js';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.
|
|
3
|
+
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.ca4784be.js';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'url';
|
|
6
6
|
import 'path';
|
|
@@ -16,10 +16,10 @@ import 'os';
|
|
|
16
16
|
import 'util';
|
|
17
17
|
import 'stream';
|
|
18
18
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
19
|
-
import './chunk-vite-node-source-map.
|
|
19
|
+
import './chunk-vite-node-source-map.d0aa773d.js';
|
|
20
20
|
import 'module';
|
|
21
21
|
import 'vm';
|
|
22
|
-
import './chunk-vite-node-utils.
|
|
22
|
+
import './chunk-vite-node-utils.9047cb87.js';
|
|
23
23
|
import 'acorn';
|
|
24
24
|
import 'assert';
|
|
25
25
|
import 'debug';
|
|
@@ -34,7 +34,7 @@ import './vendor-index.e1d4cf84.js';
|
|
|
34
34
|
import 'acorn-walk';
|
|
35
35
|
import 'worker_threads';
|
|
36
36
|
import 'tinypool';
|
|
37
|
-
import './chunk-utils-timers.
|
|
37
|
+
import './chunk-utils-timers.793fd179.js';
|
|
38
38
|
import './chunk-utils-source-map.29ff1088.js';
|
|
39
39
|
import 'crypto';
|
|
40
40
|
import './vendor-index.9c919048.js';
|
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, ao as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './types-
|
|
3
|
+
import { U as UserConfig$1, ao as ResolvedCoverageOptions, F as FakeTimerInstallOpts } from './types-79a05dee.js';
|
|
4
4
|
import 'tinybench';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'worker_threads';
|
package/dist/entry.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
2
|
import { g as getWorkerState, a as resetModules } from './chunk-typecheck-constants.ed987901.js';
|
|
3
|
-
import { v as vi } from './chunk-runtime-test-state.
|
|
3
|
+
import { v as vi } from './chunk-runtime-test-state.0037e2e0.js';
|
|
4
4
|
import { a as envs } from './chunk-env-node.67948209.js';
|
|
5
|
-
import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-setup.
|
|
5
|
+
import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-setup.bd2deed4.js';
|
|
6
6
|
import 'path';
|
|
7
7
|
import './chunk-utils-env.03f840f2.js';
|
|
8
8
|
import 'tty';
|
|
9
9
|
import 'url';
|
|
10
10
|
import 'local-pkg';
|
|
11
|
-
import './chunk-runtime-chain.
|
|
11
|
+
import './chunk-runtime-chain.dd978482.js';
|
|
12
12
|
import 'util';
|
|
13
13
|
import 'chai';
|
|
14
14
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
15
|
-
import './chunk-runtime-rpc.
|
|
16
|
-
import './chunk-utils-timers.
|
|
15
|
+
import './chunk-runtime-rpc.42aebbb9.js';
|
|
16
|
+
import './chunk-utils-timers.793fd179.js';
|
|
17
17
|
import './chunk-utils-source-map.29ff1088.js';
|
|
18
18
|
import './spy.js';
|
|
19
19
|
import 'tinyspy';
|
|
20
20
|
import 'console';
|
|
21
21
|
import 'perf_hooks';
|
|
22
22
|
import './chunk-integrations-coverage.befed097.js';
|
|
23
|
-
import './chunk-runtime-error.
|
|
23
|
+
import './chunk-runtime-error.616e92ca.js';
|
|
24
24
|
import './vendor-source-map-support.1ce17397.js';
|
|
25
25
|
import 'source-map';
|
|
26
26
|
|
package/dist/environments.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpyImpl } from 'tinyspy';
|
|
2
|
-
import { w as SuiteAPI, v as TestAPI, aw as BenchmarkAPI, y as SuiteHooks, H as HookListener, L as TestContext, p as Suite, x as HookCleanupCallback, O as OnTestFailedHandler, q as Test } from './types-
|
|
2
|
+
import { w as SuiteAPI, v as TestAPI, aw as BenchmarkAPI, y as SuiteHooks, H as HookListener, L as TestContext, p as Suite, x as HookCleanupCallback, O as OnTestFailedHandler, q as Test } from './types-79a05dee.js';
|
|
3
3
|
|
|
4
4
|
declare type Not<T extends boolean> = T extends true ? false : true;
|
|
5
5
|
declare type And<Types extends boolean[]> = Types[number] extends true ? true : false;
|
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 { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-
|
|
3
|
-
import { D as DoneCallback, F as FakeTimerInstallOpts, R as RuntimeConfig, a as File, T as TaskResultPack, b as ResolvedConfig, M as ModuleGraphData, c as Reporter } from './types-
|
|
4
|
-
export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-
|
|
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-2f15c9a8.js';
|
|
2
|
+
export { A as AssertType, E as EnhancedSpy, q as ExpectTypeOf, x as Mock, y as MockContext, w as MockInstance, z as Mocked, B as MockedClass, u as MockedFunction, v as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, r as assertType, h as beforeAll, k as beforeEach, g as bench, n as createExpect, e as describe, m as expect, p as expectTypeOf, i as it, o as onTestFailed, d as suite, t as test } from './index-2f15c9a8.js';
|
|
3
|
+
import { D as DoneCallback, F as FakeTimerInstallOpts, R as RuntimeConfig, a as File, T as TaskResultPack, b as ResolvedConfig, M as ModuleGraphData, c as Reporter } from './types-79a05dee.js';
|
|
4
|
+
export { a1 as AfterSuiteRunMeta, A as ApiConfig, a7 as ArgumentsType, a6 as Arrayable, a4 as Awaitable, ap as BaseCoverageOptions, av as BenchFunction, at as Benchmark, aw as BenchmarkAPI, au as BenchmarkResult, as as BenchmarkUserOptions, B as BuiltinEnvironment, i as CSSModuleScopeStrategy, C as CollectLineNumbers, f as CollectLines, ab as Constructable, h as Context, ar as CoverageC8Options, aq as CoverageIstanbulOptions, an as CoverageOptions, ak as CoverageProvider, al as CoverageProviderModule, am as CoverageReporter, a9 as DeepMerge, D as DoneCallback, ae as Environment, E as EnvironmentOptions, ad as EnvironmentReturn, ai as ErrorWithDiff, a as File, x as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, a8 as MergeInsertions, ac as ModuleCache, M as ModuleGraphData, aa as MutableArray, a5 as Nullable, aj as OnServerRestartHandler, O as OnTestFailedHandler, ah as ParsedStack, ag as Position, d as RawErrsMap, c as Reporter, a0 as ResolveIdFunction, b as ResolvedConfig, ao as ResolvedCoverageOptions, g as RootAndTarget, l as RunMode, R as RuntimeConfig, K as RuntimeContext, S as SequenceHooks, P as SnapshotData, X as SnapshotMatchOptions, Y as SnapshotResult, W as SnapshotStateOptions, _ as SnapshotSummary, Q as SnapshotUpdateState, p as Suite, w as SuiteAPI, z as SuiteCollector, G as SuiteFactory, y as SuiteHooks, s as Task, n as TaskBase, o as TaskResult, T as TaskResultPack, m as TaskState, q as Test, v as TestAPI, L as TestContext, t as TestFunction, u as TestOptions, e as TscErrorInfo, r as TypeCheck, k as TypecheckConfig, Z as UncheckedSnapshot, U as UserConfig, af as UserConsoleLog, N as Vitest, V as VitestEnvironment, j as VitestRunMode, $ as WorkerContext, a3 as WorkerGlobalState, a2 as WorkerRPC } from './types-79a05dee.js';
|
|
5
5
|
import { TransformResult } from 'vite';
|
|
6
6
|
import * as chai from 'chai';
|
|
7
7
|
export { chai };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
|
-
import { e as dist } from './chunk-runtime-test-state.
|
|
3
|
-
export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, k as getRunningMode, h as isFirstRun, l as isWatchMode, o as onTestFailed, g as runOnce, v as vi, j as vitest, w as withCallback } from './chunk-runtime-test-state.
|
|
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.dd978482.js';
|
|
2
|
+
import { e as dist } from './chunk-runtime-test-state.0037e2e0.js';
|
|
3
|
+
export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, k as getRunningMode, h as isFirstRun, l as isWatchMode, o as onTestFailed, g as runOnce, v as vi, j as vitest, w as withCallback } from './chunk-runtime-test-state.0037e2e0.js';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
|
@@ -12,8 +12,8 @@ import 'tty';
|
|
|
12
12
|
import 'url';
|
|
13
13
|
import 'local-pkg';
|
|
14
14
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
15
|
-
import './chunk-runtime-rpc.
|
|
16
|
-
import './chunk-utils-timers.
|
|
15
|
+
import './chunk-runtime-rpc.42aebbb9.js';
|
|
16
|
+
import './chunk-utils-timers.793fd179.js';
|
|
17
17
|
import 'fs';
|
|
18
18
|
import './chunk-utils-source-map.29ff1088.js';
|
|
19
19
|
import './spy.js';
|
package/dist/loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pathToFileURL } from 'url';
|
|
2
2
|
import { readFile } from 'fs/promises';
|
|
3
|
-
import { i as isNodeBuiltin,
|
|
3
|
+
import { i as isNodeBuiltin, n as normalizeModuleId, h as hasCJSSyntax } from './chunk-vite-node-utils.9047cb87.js';
|
|
4
4
|
import { g as getWorkerState } from './chunk-typecheck-constants.ed987901.js';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import './chunk-utils-env.03f840f2.js';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as VitestRunMode, U as UserConfig, N as Vitest, ax as ModuleCacheMap, ay as ViteNodeRunnerOptions, az as MockMap, aA as ViteNodeRunner, aB as TestSequencer } from './types-
|
|
2
|
-
export { aB as TestSequencer, aD as TestSequencerConstructor, N as Vitest, aC as startVitest } from './types-
|
|
1
|
+
import { j as VitestRunMode, U as UserConfig, N as Vitest, ax as ModuleCacheMap, ay as ViteNodeRunnerOptions, az as MockMap, aA as ViteNodeRunner, aB as TestSequencer } from './types-79a05dee.js';
|
|
2
|
+
export { aB as TestSequencer, aD as TestSequencerConstructor, N as Vitest, aC as startVitest } from './types-79a05dee.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, Plugin } from 'vite';
|
|
4
4
|
import 'tinybench';
|
|
5
5
|
import 'fs';
|
package/dist/node.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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.
|
|
1
|
+
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.ca4784be.js';
|
|
2
|
+
export { V as VitestRunner } from './chunk-runtime-mocker.34e72575.js';
|
|
3
3
|
import './chunk-utils-env.03f840f2.js';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'url';
|
|
@@ -17,10 +17,10 @@ import 'util';
|
|
|
17
17
|
import 'stream';
|
|
18
18
|
import 'events';
|
|
19
19
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
20
|
-
import './chunk-vite-node-source-map.
|
|
20
|
+
import './chunk-vite-node-source-map.d0aa773d.js';
|
|
21
21
|
import 'module';
|
|
22
22
|
import 'vm';
|
|
23
|
-
import './chunk-vite-node-utils.
|
|
23
|
+
import './chunk-vite-node-utils.9047cb87.js';
|
|
24
24
|
import 'acorn';
|
|
25
25
|
import 'assert';
|
|
26
26
|
import 'debug';
|
|
@@ -35,7 +35,7 @@ import './vendor-index.e1d4cf84.js';
|
|
|
35
35
|
import 'acorn-walk';
|
|
36
36
|
import 'worker_threads';
|
|
37
37
|
import 'tinypool';
|
|
38
|
-
import './chunk-utils-timers.
|
|
38
|
+
import './chunk-utils-timers.793fd179.js';
|
|
39
39
|
import './chunk-utils-source-map.29ff1088.js';
|
|
40
40
|
import 'crypto';
|
|
41
41
|
import './vendor-index.9c919048.js';
|
package/dist/suite.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import 'util';
|
|
2
2
|
import 'chai';
|
|
3
3
|
import './chunk-typecheck-constants.ed987901.js';
|
|
4
|
-
export { b as bench, f as clearCollectorContext, q as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.
|
|
4
|
+
export { b as bench, f as clearCollectorContext, q as createSuiteHooks, h as defaultSuite, d as describe, g as getCurrentSuite, i as it, s as suite, t as test } from './chunk-runtime-chain.dd978482.js';
|
|
5
5
|
import 'path';
|
|
6
6
|
import './chunk-utils-env.03f840f2.js';
|
|
7
7
|
import 'tty';
|
|
8
8
|
import 'url';
|
|
9
9
|
import 'local-pkg';
|
|
10
10
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
11
|
-
import './chunk-runtime-rpc.
|
|
12
|
-
import './chunk-utils-timers.
|
|
11
|
+
import './chunk-runtime-rpc.42aebbb9.js';
|
|
12
|
+
import './chunk-utils-timers.793fd179.js';
|
|
13
13
|
import 'fs';
|
|
14
14
|
import './chunk-utils-source-map.29ff1088.js';
|
|
15
15
|
import './spy.js';
|
|
@@ -323,6 +323,8 @@ interface FetchResult {
|
|
|
323
323
|
code?: string;
|
|
324
324
|
externalize?: string;
|
|
325
325
|
map?: RawSourceMap;
|
|
326
|
+
id?: string;
|
|
327
|
+
file?: string;
|
|
326
328
|
}
|
|
327
329
|
declare type HotContext = Omit<ViteHotContext, 'acceptDeps' | 'decline'>;
|
|
328
330
|
declare type FetchFunction = (id: string) => Promise<FetchResult>;
|
package/dist/worker.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { b as resolve, e as distDir } from './chunk-utils-env.03f840f2.js';
|
|
2
|
-
import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-source-map.
|
|
2
|
+
import { c as createBirpc, M as ModuleCacheMap } from './chunk-vite-node-source-map.d0aa773d.js';
|
|
3
3
|
import { workerId } from 'tinypool';
|
|
4
4
|
import { g as getWorkerState } from './chunk-typecheck-constants.ed987901.js';
|
|
5
|
-
import { e as executeInViteNode } from './chunk-runtime-mocker.
|
|
6
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
7
|
-
import { p as processError } from './chunk-runtime-error.
|
|
5
|
+
import { e as executeInViteNode } from './chunk-runtime-mocker.34e72575.js';
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.42aebbb9.js';
|
|
7
|
+
import { p as processError } from './chunk-runtime-error.616e92ca.js';
|
|
8
8
|
import 'tty';
|
|
9
9
|
import 'url';
|
|
10
10
|
import 'path';
|
|
11
11
|
import 'module';
|
|
12
12
|
import 'vm';
|
|
13
|
-
import './chunk-vite-node-utils.
|
|
13
|
+
import './chunk-vite-node-utils.9047cb87.js';
|
|
14
14
|
import 'fs';
|
|
15
15
|
import 'acorn';
|
|
16
16
|
import 'assert';
|
|
@@ -20,7 +20,7 @@ import './vendor-source-map-support.1ce17397.js';
|
|
|
20
20
|
import 'source-map';
|
|
21
21
|
import 'local-pkg';
|
|
22
22
|
import 'vite';
|
|
23
|
-
import './chunk-utils-timers.
|
|
23
|
+
import './chunk-utils-timers.793fd179.js';
|
|
24
24
|
import 'chai';
|
|
25
25
|
|
|
26
26
|
let _viteNode;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.25.
|
|
4
|
+
"version": "0.25.5",
|
|
5
5
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"@types/natural-compare": "^1.4.1",
|
|
126
126
|
"@types/prompts": "^2.4.1",
|
|
127
127
|
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
128
|
-
"@vitest/ui": "0.25.
|
|
128
|
+
"@vitest/ui": "0.25.5",
|
|
129
129
|
"birpc": "^0.2.3",
|
|
130
130
|
"cac": "^6.7.14",
|
|
131
131
|
"chai-subset": "^1.6.0",
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"rollup": "^2.79.1",
|
|
155
155
|
"strip-ansi": "^7.0.1",
|
|
156
156
|
"typescript": "^4.8.4",
|
|
157
|
-
"vite-node": "0.25.
|
|
157
|
+
"vite-node": "0.25.5",
|
|
158
158
|
"ws": "^8.11.0"
|
|
159
159
|
},
|
|
160
160
|
"scripts": {
|