vitest 0.26.0 → 0.26.1
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/browser.d.ts +1 -0
- package/dist/browser.d.ts +5 -5
- package/dist/browser.js +16 -14
- package/dist/{chunk-api-setup.08f3b356.js → chunk-api-setup.adeab271.js} +7 -5
- package/dist/{chunk-env-node.67948209.js → chunk-env-node.b3664da2.js} +1 -1
- package/dist/{chunk-install-pkg.579a5a27.js → chunk-install-pkg.6dd2bae6.js} +19 -19
- package/dist/chunk-integrations-globals.96914902.js +27 -0
- package/dist/{chunk-node-git.5a1b1656.js → chunk-node-git.a90c0582.js} +10 -6
- package/dist/{chunk-runtime-chain.e655f6cc.js → chunk-runtime-chain.4cd984be.js} +7 -6
- package/dist/{chunk-runtime-error.dfbbf9be.js → chunk-runtime-error.f5c8aaf2.js} +6 -4
- package/dist/{chunk-runtime-mocker.35fabb8b.js → chunk-runtime-mocker.3fa602ba.js} +11 -4
- package/dist/{chunk-runtime-rpc.7959fc79.js → chunk-runtime-rpc.54d72169.js} +2 -2
- package/dist/{chunk-runtime-setup.4c1b529e.js → chunk-runtime-setup.9cdedce6.js} +15 -15
- package/dist/{chunk-snapshot-manager.7d978f79.js → chunk-snapshot-manager.e54d78b8.js} +52 -42
- package/dist/{chunk-typecheck-constants.3f865d14.js → chunk-typecheck-constants.06e1fe5b.js} +3 -3
- package/dist/{chunk-utils-env.03f840f2.js → chunk-utils-env.3fdc1793.js} +8 -8
- package/dist/{chunk-utils-import.ca62c9d7.js → chunk-utils-import.afe2ffde.js} +4 -4
- package/dist/{chunk-utils-source-map.5bbb50cd.js → chunk-utils-source-map.59ba6b0a.js} +2 -2
- package/dist/{chunk-utils-timers.793fd179.js → chunk-utils-timers.715da787.js} +31 -15
- package/dist/cli-wrapper.js +10 -5
- package/dist/cli.js +22 -16
- package/dist/config.d.ts +3 -3
- package/dist/entry.js +16 -14
- package/dist/environments.d.ts +3 -3
- package/dist/environments.js +2 -2
- package/dist/{index-c3f83a58.d.ts → index-1e9f7f83.d.ts} +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +12 -10
- package/dist/loader.js +10 -6
- package/dist/node.d.ts +5 -4
- package/dist/node.js +25 -17
- package/dist/suite.js +10 -8
- package/dist/{types-56bcd6c3.d.ts → types-c41bae41.d.ts} +23 -6
- package/dist/{vendor-index.96e022fd.js → vendor-index.2e96c50b.js} +6 -2
- package/dist/{vendor-index.e1d4cf84.js → vendor-index.7a2cebfe.js} +16 -16
- package/dist/{vendor-index.737c3cff.js → vendor-index.b2fdde54.js} +9 -8
- package/dist/worker.js +14 -9
- package/environments.d.ts +1 -0
- package/package.json +3 -3
- package/dist/chunk-integrations-globals.cab94a09.js +0 -25
package/dist/config.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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-c41bae41.js';
|
|
4
4
|
import 'tinybench';
|
|
5
5
|
import 'vite-node/client';
|
|
6
6
|
import 'vite-node/server';
|
|
7
7
|
import 'vite-node';
|
|
8
|
-
import 'fs';
|
|
9
|
-
import 'worker_threads';
|
|
8
|
+
import 'node:fs';
|
|
9
|
+
import 'node:worker_threads';
|
|
10
10
|
|
|
11
11
|
declare const defaultInclude: string[];
|
|
12
12
|
declare const defaultExclude: string[];
|
package/dist/entry.js
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { promises } from 'fs';
|
|
2
|
-
import { g as getWorkerState, a as resetModules } from './chunk-typecheck-constants.
|
|
3
|
-
import { v as vi } from './chunk-utils-import.
|
|
4
|
-
import { a as envs } from './chunk-env-node.
|
|
5
|
-
import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-setup.
|
|
6
|
-
import 'path';
|
|
7
|
-
import './chunk-utils-env.
|
|
1
|
+
import { promises } from 'node:fs';
|
|
2
|
+
import { g as getWorkerState, a as resetModules } from './chunk-typecheck-constants.06e1fe5b.js';
|
|
3
|
+
import { v as vi } from './chunk-utils-import.afe2ffde.js';
|
|
4
|
+
import { a as envs } from './chunk-env-node.b3664da2.js';
|
|
5
|
+
import { a as setupGlobalEnv, s as startTests, w as withEnv } from './chunk-runtime-setup.9cdedce6.js';
|
|
6
|
+
import 'node:path';
|
|
7
|
+
import './chunk-utils-env.3fdc1793.js';
|
|
8
8
|
import 'tty';
|
|
9
|
-
import 'url';
|
|
9
|
+
import 'node:url';
|
|
10
|
+
import 'path';
|
|
10
11
|
import 'local-pkg';
|
|
11
|
-
import './chunk-runtime-chain.
|
|
12
|
+
import './chunk-runtime-chain.4cd984be.js';
|
|
12
13
|
import 'util';
|
|
13
14
|
import 'chai';
|
|
14
15
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
15
|
-
import './chunk-runtime-rpc.
|
|
16
|
-
import './chunk-utils-timers.
|
|
17
|
-
import './chunk-utils-source-map.
|
|
16
|
+
import './chunk-runtime-rpc.54d72169.js';
|
|
17
|
+
import './chunk-utils-timers.715da787.js';
|
|
18
|
+
import './chunk-utils-source-map.59ba6b0a.js';
|
|
19
|
+
import 'fs';
|
|
18
20
|
import './spy.js';
|
|
19
21
|
import 'tinyspy';
|
|
20
|
-
import 'console';
|
|
22
|
+
import 'node:console';
|
|
21
23
|
import 'perf_hooks';
|
|
22
24
|
import './chunk-integrations-coverage.befed097.js';
|
|
23
|
-
import './chunk-runtime-error.
|
|
25
|
+
import './chunk-runtime-error.f5c8aaf2.js';
|
|
24
26
|
import 'vite-node/source-map';
|
|
25
27
|
|
|
26
28
|
function groupBy(collection, iteratee) {
|
package/dist/environments.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ae as Environment } from './types-
|
|
1
|
+
import { ae as Environment } from './types-c41bae41.js';
|
|
2
2
|
import 'vite';
|
|
3
3
|
import 'tinybench';
|
|
4
4
|
import 'vite-node/client';
|
|
5
5
|
import 'vite-node/server';
|
|
6
6
|
import 'vite-node';
|
|
7
|
-
import 'fs';
|
|
8
|
-
import 'worker_threads';
|
|
7
|
+
import 'node:fs';
|
|
8
|
+
import 'node:worker_threads';
|
|
9
9
|
|
|
10
10
|
declare const environments: {
|
|
11
11
|
node: Environment;
|
package/dist/environments.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { e as builtinEnvironments, p as populateGlobal } from './chunk-env-node.
|
|
2
|
-
import 'console';
|
|
1
|
+
export { e as builtinEnvironments, p as populateGlobal } from './chunk-env-node.b3664da2.js';
|
|
2
|
+
import 'node:console';
|
|
3
3
|
import 'local-pkg';
|
|
@@ -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-c41bae41.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-1e9f7f83.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-1e9f7f83.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-c41bae41.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-c41bae41.js';
|
|
5
5
|
import { TransformResult } from 'vite';
|
|
6
6
|
import * as chai from 'chai';
|
|
7
7
|
export { chai };
|
|
@@ -11,8 +11,8 @@ import 'tinyspy';
|
|
|
11
11
|
import 'vite-node/client';
|
|
12
12
|
import 'vite-node/server';
|
|
13
13
|
import 'vite-node';
|
|
14
|
-
import 'fs';
|
|
15
|
-
import 'worker_threads';
|
|
14
|
+
import 'node:fs';
|
|
15
|
+
import 'node:worker_threads';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* A simple wrapper for converting callback style to promise
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
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-utils-import.
|
|
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-utils-import.
|
|
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.4cd984be.js';
|
|
2
|
+
import { e as dist } from './chunk-utils-import.afe2ffde.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-utils-import.afe2ffde.js';
|
|
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-typecheck-constants.
|
|
9
|
-
import 'path';
|
|
10
|
-
import './chunk-utils-env.
|
|
8
|
+
import './chunk-typecheck-constants.06e1fe5b.js';
|
|
9
|
+
import 'node:path';
|
|
10
|
+
import './chunk-utils-env.3fdc1793.js';
|
|
11
11
|
import 'tty';
|
|
12
|
-
import 'url';
|
|
12
|
+
import 'node:url';
|
|
13
|
+
import 'path';
|
|
13
14
|
import 'local-pkg';
|
|
14
15
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
15
|
-
import './chunk-runtime-rpc.
|
|
16
|
-
import './chunk-utils-timers.
|
|
16
|
+
import './chunk-runtime-rpc.54d72169.js';
|
|
17
|
+
import './chunk-utils-timers.715da787.js';
|
|
18
|
+
import 'node:fs';
|
|
19
|
+
import './chunk-utils-source-map.59ba6b0a.js';
|
|
17
20
|
import 'fs';
|
|
18
|
-
import './chunk-utils-source-map.5bbb50cd.js';
|
|
19
21
|
import './spy.js';
|
|
20
22
|
import 'tinyspy';
|
|
21
23
|
|
package/dist/loader.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { pathToFileURL } from 'url';
|
|
2
|
-
import { readFile } from 'fs/promises';
|
|
3
|
-
import { i as isNodeBuiltin, h as hasCJSSyntax } from './vendor-index.
|
|
1
|
+
import { pathToFileURL } from 'node:url';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { i as isNodeBuiltin, h as hasCJSSyntax } from './vendor-index.2e96c50b.js';
|
|
4
4
|
import { normalizeModuleId } from 'vite-node/utils';
|
|
5
|
-
import { g as getWorkerState } from './chunk-typecheck-constants.
|
|
5
|
+
import { g as getWorkerState } from './chunk-typecheck-constants.06e1fe5b.js';
|
|
6
6
|
import 'acorn';
|
|
7
|
-
import 'module';
|
|
7
|
+
import 'node:module';
|
|
8
|
+
import 'node:fs';
|
|
9
|
+
import 'url';
|
|
8
10
|
import 'fs';
|
|
9
11
|
import 'path';
|
|
12
|
+
import 'module';
|
|
10
13
|
import 'assert';
|
|
11
14
|
import 'util';
|
|
12
|
-
import '
|
|
15
|
+
import 'node:path';
|
|
16
|
+
import './chunk-utils-env.3fdc1793.js';
|
|
13
17
|
import 'tty';
|
|
14
18
|
import 'local-pkg';
|
|
15
19
|
|
package/dist/node.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { j as VitestRunMode, U as UserConfig, N as Vitest, ax as MockMap, ay as TestSequencer } from './types-
|
|
2
|
-
export { ay as TestSequencer, aA as TestSequencerConstructor, N as Vitest, az as startVitest } from './types-
|
|
1
|
+
import { j as VitestRunMode, U as UserConfig, N as Vitest, ax as MockMap, ay as TestSequencer } from './types-c41bae41.js';
|
|
2
|
+
export { ay as TestSequencer, aA as TestSequencerConstructor, N as Vitest, az as startVitest } from './types-c41bae41.js';
|
|
3
3
|
import { UserConfig as UserConfig$1, Plugin } from 'vite';
|
|
4
4
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
5
5
|
import { ViteNodeRunnerOptions } from 'vite-node';
|
|
6
6
|
import 'tinybench';
|
|
7
7
|
import 'vite-node/server';
|
|
8
|
-
import 'fs';
|
|
9
|
-
import 'worker_threads';
|
|
8
|
+
import 'node:fs';
|
|
9
|
+
import 'node:worker_threads';
|
|
10
10
|
|
|
11
11
|
declare function createVitest(mode: VitestRunMode, options: UserConfig, viteOverrides?: UserConfig$1): Promise<Vitest>;
|
|
12
12
|
|
|
@@ -53,6 +53,7 @@ declare class VitestRunner extends ViteNodeRunner {
|
|
|
53
53
|
options: ExecuteOptions;
|
|
54
54
|
mocker: VitestMocker;
|
|
55
55
|
constructor(options: ExecuteOptions);
|
|
56
|
+
shouldResolveId(id: string, _importee?: string | undefined): boolean;
|
|
56
57
|
resolveUrl(id: string, importee?: string): Promise<[url: string, fsPath: string]>;
|
|
57
58
|
dependencyRequest(id: string, fsPath: string, callstack: string[]): Promise<any>;
|
|
58
59
|
prepareContext(context: Record<string, any>): Record<string, any> & {
|
package/dist/node.js
CHANGED
|
@@ -1,45 +1,53 @@
|
|
|
1
|
-
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-snapshot-manager.
|
|
2
|
-
export { V as VitestRunner } from './chunk-runtime-mocker.
|
|
3
|
-
import './chunk-utils-env.
|
|
1
|
+
export { B as BaseSequencer, V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-snapshot-manager.e54d78b8.js';
|
|
2
|
+
export { V as VitestRunner } from './chunk-runtime-mocker.3fa602ba.js';
|
|
3
|
+
import './chunk-utils-env.3fdc1793.js';
|
|
4
4
|
import 'tty';
|
|
5
|
-
import 'url';
|
|
5
|
+
import 'node:url';
|
|
6
6
|
import 'path';
|
|
7
7
|
import './chunk-integrations-coverage.befed097.js';
|
|
8
8
|
import 'local-pkg';
|
|
9
|
-
import './chunk-env-node.
|
|
10
|
-
import 'console';
|
|
11
|
-
import './chunk-typecheck-constants.
|
|
9
|
+
import './chunk-env-node.b3664da2.js';
|
|
10
|
+
import 'node:console';
|
|
11
|
+
import './chunk-typecheck-constants.06e1fe5b.js';
|
|
12
|
+
import 'node:path';
|
|
12
13
|
import 'vite';
|
|
13
|
-
import 'process';
|
|
14
|
-
import 'fs';
|
|
14
|
+
import 'node:process';
|
|
15
|
+
import 'node:fs';
|
|
15
16
|
import 'os';
|
|
16
17
|
import 'util';
|
|
17
18
|
import 'stream';
|
|
18
19
|
import 'events';
|
|
20
|
+
import 'fs';
|
|
19
21
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
20
22
|
import 'vite-node/client';
|
|
21
23
|
import 'vite-node/server';
|
|
22
|
-
import 'fs/promises';
|
|
23
|
-
import './vendor-index.
|
|
24
|
-
import 'buffer';
|
|
24
|
+
import 'node:fs/promises';
|
|
25
|
+
import './vendor-index.b2fdde54.js';
|
|
26
|
+
import 'node:buffer';
|
|
27
|
+
import 'node:child_process';
|
|
28
|
+
import './vendor-index.7a2cebfe.js';
|
|
25
29
|
import 'child_process';
|
|
26
|
-
import './vendor-index.e1d4cf84.js';
|
|
27
30
|
import 'assert';
|
|
31
|
+
import 'buffer';
|
|
32
|
+
import 'node:os';
|
|
28
33
|
import 'source-map';
|
|
29
34
|
import 'module';
|
|
30
35
|
import 'acorn';
|
|
31
36
|
import 'acorn-walk';
|
|
32
|
-
import 'worker_threads';
|
|
37
|
+
import 'node:worker_threads';
|
|
33
38
|
import 'tinypool';
|
|
34
39
|
import './vendor-index.783e7f3e.js';
|
|
35
40
|
import 'perf_hooks';
|
|
36
|
-
import './chunk-utils-timers.
|
|
37
|
-
import './chunk-utils-source-map.
|
|
41
|
+
import './chunk-utils-timers.715da787.js';
|
|
42
|
+
import './chunk-utils-source-map.59ba6b0a.js';
|
|
38
43
|
import 'crypto';
|
|
39
44
|
import 'vite-node/utils';
|
|
40
45
|
import './vendor-index.9c919048.js';
|
|
46
|
+
import 'node:crypto';
|
|
41
47
|
import './chunk-magic-string.3a794426.js';
|
|
42
48
|
import 'strip-literal';
|
|
43
49
|
import 'readline';
|
|
44
50
|
import './vendor-index.9f20a9be.js';
|
|
45
|
-
import './vendor-index.
|
|
51
|
+
import './vendor-index.2e96c50b.js';
|
|
52
|
+
import 'node:module';
|
|
53
|
+
import 'url';
|
package/dist/suite.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import 'util';
|
|
2
2
|
import 'chai';
|
|
3
|
-
import './chunk-typecheck-constants.
|
|
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.
|
|
5
|
-
import 'path';
|
|
6
|
-
import './chunk-utils-env.
|
|
3
|
+
import './chunk-typecheck-constants.06e1fe5b.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.4cd984be.js';
|
|
5
|
+
import 'node:path';
|
|
6
|
+
import './chunk-utils-env.3fdc1793.js';
|
|
7
7
|
import 'tty';
|
|
8
|
-
import 'url';
|
|
8
|
+
import 'node:url';
|
|
9
|
+
import 'path';
|
|
9
10
|
import 'local-pkg';
|
|
10
11
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
11
|
-
import './chunk-runtime-rpc.
|
|
12
|
-
import './chunk-utils-timers.
|
|
12
|
+
import './chunk-runtime-rpc.54d72169.js';
|
|
13
|
+
import './chunk-utils-timers.715da787.js';
|
|
14
|
+
import 'node:fs';
|
|
15
|
+
import './chunk-utils-source-map.59ba6b0a.js';
|
|
13
16
|
import 'fs';
|
|
14
|
-
import './chunk-utils-source-map.5bbb50cd.js';
|
|
15
17
|
import './spy.js';
|
|
16
18
|
import 'tinyspy';
|
|
@@ -3,8 +3,8 @@ import { Task as Task$1, TaskResult as TaskResult$1, Bench, Options } from 'tiny
|
|
|
3
3
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
4
4
|
import { ViteNodeServer } from 'vite-node/server';
|
|
5
5
|
import { RawSourceMap, ViteNodeResolveId, FetchFunction, ModuleCacheMap } from 'vite-node';
|
|
6
|
-
import { Stats } from 'fs';
|
|
7
|
-
import { MessagePort } from 'worker_threads';
|
|
6
|
+
import { Stats } from 'node:fs';
|
|
7
|
+
import { MessagePort } from 'node:worker_threads';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
@@ -1564,17 +1564,32 @@ interface InlineConfig {
|
|
|
1564
1564
|
root?: string;
|
|
1565
1565
|
/**
|
|
1566
1566
|
* Custom reporter for output. Can contain one or more built-in report names, reporter instances,
|
|
1567
|
-
* and/or paths to custom reporters
|
|
1567
|
+
* and/or paths to custom reporters.
|
|
1568
1568
|
*/
|
|
1569
1569
|
reporters?: Arrayable<BuiltinReporters | 'html' | Reporter | Omit<string, BuiltinReporters>>;
|
|
1570
1570
|
/**
|
|
1571
|
-
*
|
|
1571
|
+
* Truncates lines in the output to the given length.
|
|
1572
|
+
* @default stdout.columns || 80
|
|
1572
1573
|
*/
|
|
1573
1574
|
outputTruncateLength?: number;
|
|
1574
1575
|
/**
|
|
1575
|
-
* number of
|
|
1576
|
+
* Maximum number of line to show in a single diff.
|
|
1577
|
+
* @default 15
|
|
1576
1578
|
*/
|
|
1577
1579
|
outputDiffLines?: number;
|
|
1580
|
+
/**
|
|
1581
|
+
* The maximum number of characters allowed in a single object before doing a diff.
|
|
1582
|
+
* Vitest tries to stringify an object before doing a diff, but if the object is too large,
|
|
1583
|
+
* it will reduce the depth of the object to fit within this limit.
|
|
1584
|
+
* Because of this if object is too big or nested, you might not see the diff.
|
|
1585
|
+
* @default 10000
|
|
1586
|
+
*/
|
|
1587
|
+
outputDiffMaxSize?: number;
|
|
1588
|
+
/**
|
|
1589
|
+
* Maximum number of lines in a diff overall.
|
|
1590
|
+
* @default 50
|
|
1591
|
+
*/
|
|
1592
|
+
outputDiffMaxLines?: number;
|
|
1578
1593
|
/**
|
|
1579
1594
|
* Write test results to a file when the --reporter=json` or `--reporter=junit` option is also specified.
|
|
1580
1595
|
* Also definable individually per reporter by using an object instead.
|
|
@@ -1988,7 +2003,9 @@ declare const INVERTED_COLOR: Formatter;
|
|
|
1988
2003
|
declare const BOLD_WEIGHT: Formatter;
|
|
1989
2004
|
declare const DIM_COLOR: Formatter;
|
|
1990
2005
|
declare function matcherHint(matcherName: string, received?: string, expected?: string, options?: MatcherHintOptions): string;
|
|
1991
|
-
declare function stringify(object: unknown, maxDepth?: number, options?: PrettyFormatOptions
|
|
2006
|
+
declare function stringify(object: unknown, maxDepth?: number, { maxLength, ...options }?: PrettyFormatOptions & {
|
|
2007
|
+
maxLength?: number;
|
|
2008
|
+
}): string;
|
|
1992
2009
|
declare const printReceived: (object: unknown) => string;
|
|
1993
2010
|
declare const printExpected: (value: unknown) => string;
|
|
1994
2011
|
declare function diff(a: any, b: any, options?: DiffOptions): string;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import 'acorn';
|
|
2
|
-
import { builtinModules } from 'module';
|
|
2
|
+
import { builtinModules } from 'node:module';
|
|
3
|
+
import 'node:fs';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import 'url';
|
|
3
6
|
import 'fs';
|
|
4
|
-
import { pathToFileURL } from 'url';
|
|
5
7
|
import 'path';
|
|
8
|
+
import 'module';
|
|
6
9
|
import assert from 'assert';
|
|
7
10
|
import { format, inspect } from 'util';
|
|
11
|
+
import 'node:path';
|
|
8
12
|
|
|
9
13
|
const BUILTIN_MODULES = new Set(builtinModules);
|
|
10
14
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import require$$0$1 from 'child_process';
|
|
2
|
+
import g from 'path';
|
|
3
3
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
|
|
4
|
-
import
|
|
4
|
+
import require$$0 from 'fs';
|
|
5
5
|
import assert$1 from 'assert';
|
|
6
6
|
import require$$2 from 'events';
|
|
7
|
-
import require$$0$
|
|
8
|
-
import require$$0 from 'stream';
|
|
7
|
+
import require$$0$3 from 'buffer';
|
|
8
|
+
import require$$0$2 from 'stream';
|
|
9
9
|
import util from 'util';
|
|
10
10
|
|
|
11
11
|
var crossSpawn = {exports: {}};
|
|
@@ -19,7 +19,7 @@ function requireWindows () {
|
|
|
19
19
|
windows = isexe;
|
|
20
20
|
isexe.sync = sync;
|
|
21
21
|
|
|
22
|
-
var fs =
|
|
22
|
+
var fs = require$$0;
|
|
23
23
|
|
|
24
24
|
function checkPathExt (path, options) {
|
|
25
25
|
var pathext = options.pathExt !== undefined ?
|
|
@@ -70,7 +70,7 @@ function requireMode () {
|
|
|
70
70
|
mode = isexe;
|
|
71
71
|
isexe.sync = sync;
|
|
72
72
|
|
|
73
|
-
var fs =
|
|
73
|
+
var fs = require$$0;
|
|
74
74
|
|
|
75
75
|
function isexe (path, options, cb) {
|
|
76
76
|
fs.stat(path, function (er, stat) {
|
|
@@ -172,7 +172,7 @@ const isWindows = process.platform === 'win32' ||
|
|
|
172
172
|
process.env.OSTYPE === 'cygwin' ||
|
|
173
173
|
process.env.OSTYPE === 'msys';
|
|
174
174
|
|
|
175
|
-
const path$2 =
|
|
175
|
+
const path$2 = g;
|
|
176
176
|
const COLON = isWindows ? ';' : ':';
|
|
177
177
|
const isexe = isexe_1;
|
|
178
178
|
|
|
@@ -311,7 +311,7 @@ pathKey$1.exports = pathKey;
|
|
|
311
311
|
// TODO: Remove this for the next major release
|
|
312
312
|
pathKey$1.exports.default = pathKey;
|
|
313
313
|
|
|
314
|
-
const path$1 =
|
|
314
|
+
const path$1 = g;
|
|
315
315
|
const which = which_1;
|
|
316
316
|
const getPathKey = pathKey$1.exports;
|
|
317
317
|
|
|
@@ -429,7 +429,7 @@ var shebangCommand$1 = (string = '') => {
|
|
|
429
429
|
return argument ? `${binary} ${argument}` : binary;
|
|
430
430
|
};
|
|
431
431
|
|
|
432
|
-
const fs =
|
|
432
|
+
const fs = require$$0;
|
|
433
433
|
const shebangCommand = shebangCommand$1;
|
|
434
434
|
|
|
435
435
|
function readShebang$1(command) {
|
|
@@ -451,7 +451,7 @@ function readShebang$1(command) {
|
|
|
451
451
|
|
|
452
452
|
var readShebang_1 = readShebang$1;
|
|
453
453
|
|
|
454
|
-
const path =
|
|
454
|
+
const path = g;
|
|
455
455
|
const resolveCommand = resolveCommand_1;
|
|
456
456
|
const escape = _escape;
|
|
457
457
|
const readShebang = readShebang_1;
|
|
@@ -599,7 +599,7 @@ var enoent$1 = {
|
|
|
599
599
|
notFoundError,
|
|
600
600
|
};
|
|
601
601
|
|
|
602
|
-
const cp =
|
|
602
|
+
const cp = require$$0$1;
|
|
603
603
|
const parse = parse_1;
|
|
604
604
|
const enoent = enoent$1;
|
|
605
605
|
|
|
@@ -909,7 +909,7 @@ if (!processOk(process$1)) {
|
|
|
909
909
|
|
|
910
910
|
var getStream$1 = {exports: {}};
|
|
911
911
|
|
|
912
|
-
const {PassThrough: PassThroughStream} = require$$0;
|
|
912
|
+
const {PassThrough: PassThroughStream} = require$$0$2;
|
|
913
913
|
|
|
914
914
|
var bufferStream$1 = options => {
|
|
915
915
|
options = {...options};
|
|
@@ -961,8 +961,8 @@ var bufferStream$1 = options => {
|
|
|
961
961
|
return stream;
|
|
962
962
|
};
|
|
963
963
|
|
|
964
|
-
const {constants: BufferConstants} = require$$0$
|
|
965
|
-
const stream = require$$0;
|
|
964
|
+
const {constants: BufferConstants} = require$$0$3;
|
|
965
|
+
const stream = require$$0$2;
|
|
966
966
|
const {promisify} = util;
|
|
967
967
|
const bufferStream = bufferStream$1;
|
|
968
968
|
|
|
@@ -1022,7 +1022,7 @@ getStream$1.exports.buffer = (stream, options) => getStream(stream, {...options,
|
|
|
1022
1022
|
getStream$1.exports.array = (stream, options) => getStream(stream, {...options, array: true});
|
|
1023
1023
|
getStream$1.exports.MaxBufferError = MaxBufferError;
|
|
1024
1024
|
|
|
1025
|
-
const { PassThrough } = require$$0;
|
|
1025
|
+
const { PassThrough } = require$$0$2;
|
|
1026
1026
|
|
|
1027
1027
|
var mergeStream = function (/*streams...*/) {
|
|
1028
1028
|
var sources = [];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Buffer } from 'buffer';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import childProcess from 'child_process';
|
|
4
|
-
import process$1 from 'process';
|
|
5
|
-
import { s as signalExit, m as mergeStream, g as getStream, c as crossSpawn } from './vendor-index.
|
|
6
|
-
import url from 'url';
|
|
7
|
-
import
|
|
1
|
+
import { Buffer } from 'node:buffer';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import childProcess from 'node:child_process';
|
|
4
|
+
import process$1 from 'node:process';
|
|
5
|
+
import { s as signalExit, m as mergeStream, g as getStream, c as crossSpawn } from './vendor-index.7a2cebfe.js';
|
|
6
|
+
import url from 'node:url';
|
|
7
|
+
import { constants } from 'os';
|
|
8
|
+
import os from 'node:os';
|
|
8
9
|
|
|
9
10
|
function stripFinalNewline(input) {
|
|
10
11
|
const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
|
|
@@ -704,7 +705,7 @@ const setKillTimeout = (kill, signal, options, killResult) => {
|
|
|
704
705
|
|
|
705
706
|
const shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
|
|
706
707
|
|
|
707
|
-
const isSigterm = signal => signal ===
|
|
708
|
+
const isSigterm = signal => signal === os.constants.signals.SIGTERM
|
|
708
709
|
|| (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM');
|
|
709
710
|
|
|
710
711
|
const getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => {
|
package/dist/worker.js
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import { b as resolve, e as distDir } from './chunk-utils-env.
|
|
1
|
+
import { b as resolve, e as distDir } from './chunk-utils-env.3fdc1793.js';
|
|
2
2
|
import { c as createBirpc } from './vendor-index.783e7f3e.js';
|
|
3
3
|
import { workerId } from 'tinypool';
|
|
4
4
|
import { ModuleCacheMap } from 'vite-node/client';
|
|
5
|
-
import { g as getWorkerState } from './chunk-typecheck-constants.
|
|
6
|
-
import { e as executeInViteNode } from './chunk-runtime-mocker.
|
|
7
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
8
|
-
import { p as processError } from './chunk-runtime-error.
|
|
5
|
+
import { g as getWorkerState } from './chunk-typecheck-constants.06e1fe5b.js';
|
|
6
|
+
import { e as executeInViteNode } from './chunk-runtime-mocker.3fa602ba.js';
|
|
7
|
+
import { r as rpc } from './chunk-runtime-rpc.54d72169.js';
|
|
8
|
+
import { p as processError } from './chunk-runtime-error.f5c8aaf2.js';
|
|
9
9
|
import 'tty';
|
|
10
|
-
import 'url';
|
|
10
|
+
import 'node:url';
|
|
11
11
|
import 'path';
|
|
12
|
+
import 'node:path';
|
|
12
13
|
import 'local-pkg';
|
|
14
|
+
import 'vite-node/utils';
|
|
13
15
|
import 'vite';
|
|
14
|
-
import '
|
|
15
|
-
import './vendor-index.96e022fd.js';
|
|
16
|
+
import './vendor-index.2e96c50b.js';
|
|
16
17
|
import 'acorn';
|
|
18
|
+
import 'node:module';
|
|
19
|
+
import 'node:fs';
|
|
20
|
+
import 'url';
|
|
21
|
+
import 'fs';
|
|
17
22
|
import 'module';
|
|
18
23
|
import 'assert';
|
|
19
24
|
import 'util';
|
|
20
|
-
import './chunk-utils-timers.
|
|
25
|
+
import './chunk-utils-timers.715da787.js';
|
|
21
26
|
import 'chai';
|
|
22
27
|
|
|
23
28
|
let _viteNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/environments'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.26.
|
|
4
|
+
"version": "0.26.1",
|
|
5
5
|
"description": "A blazing fast unit test framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"tinypool": "^0.3.0",
|
|
115
115
|
"tinyspy": "^1.0.2",
|
|
116
116
|
"vite": "^3.0.0 || ^4.0.0",
|
|
117
|
-
"vite-node": "0.26.
|
|
117
|
+
"vite-node": "0.26.1"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
120
|
"@antfu/install-pkg": "^0.1.1",
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"strip-ansi": "^7.0.1",
|
|
156
156
|
"typescript": "^4.9.4",
|
|
157
157
|
"ws": "^8.11.0",
|
|
158
|
-
"@vitest/ui": "0.26.
|
|
158
|
+
"@vitest/ui": "0.26.1"
|
|
159
159
|
},
|
|
160
160
|
"scripts": {
|
|
161
161
|
"build": "rimraf dist && rollup -c",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { m as globalApis } from './chunk-utils-env.03f840f2.js';
|
|
2
|
-
import { i as index } from './chunk-utils-import.ca62c9d7.js';
|
|
3
|
-
import 'tty';
|
|
4
|
-
import 'url';
|
|
5
|
-
import 'path';
|
|
6
|
-
import './chunk-runtime-chain.e655f6cc.js';
|
|
7
|
-
import 'util';
|
|
8
|
-
import 'chai';
|
|
9
|
-
import './chunk-typecheck-constants.3f865d14.js';
|
|
10
|
-
import 'local-pkg';
|
|
11
|
-
import './vendor-_commonjsHelpers.addc3445.js';
|
|
12
|
-
import './chunk-runtime-rpc.7959fc79.js';
|
|
13
|
-
import './chunk-utils-timers.793fd179.js';
|
|
14
|
-
import 'fs';
|
|
15
|
-
import './chunk-utils-source-map.5bbb50cd.js';
|
|
16
|
-
import './spy.js';
|
|
17
|
-
import 'tinyspy';
|
|
18
|
-
|
|
19
|
-
function registerApiGlobally() {
|
|
20
|
-
globalApis.forEach((api) => {
|
|
21
|
-
globalThis[api] = index[api];
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { registerApiGlobally };
|