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/browser.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/browser'
|
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-1e9f7f83.js';
|
|
2
|
+
import { b as ResolvedConfig } from './types-c41bae41.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-c41bae41.js';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
|
@@ -10,8 +10,8 @@ import 'vite';
|
|
|
10
10
|
import 'vite-node/client';
|
|
11
11
|
import 'vite-node/server';
|
|
12
12
|
import 'vite-node';
|
|
13
|
-
import 'fs';
|
|
14
|
-
import 'worker_threads';
|
|
13
|
+
import 'node:fs';
|
|
14
|
+
import 'node:worker_threads';
|
|
15
15
|
|
|
16
16
|
declare function startTests(paths: string[], config: ResolvedConfig): Promise<void>;
|
|
17
17
|
|
package/dist/browser.js
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
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-utils-import.
|
|
3
|
-
export { a as afterAll, d as afterEach, f as assertType, b as beforeAll, c as beforeEach, o as onTestFailed } from './chunk-utils-import.
|
|
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.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, o as onTestFailed } from './chunk-utils-import.afe2ffde.js';
|
|
4
|
+
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-setup.9cdedce6.js';
|
|
5
5
|
import * as chai from 'chai';
|
|
6
6
|
export { chai };
|
|
7
7
|
export { assert, should } from 'chai';
|
|
8
8
|
import 'util';
|
|
9
|
-
import './chunk-typecheck-constants.
|
|
10
|
-
import 'path';
|
|
11
|
-
import './chunk-utils-env.
|
|
9
|
+
import './chunk-typecheck-constants.06e1fe5b.js';
|
|
10
|
+
import 'node:path';
|
|
11
|
+
import './chunk-utils-env.3fdc1793.js';
|
|
12
12
|
import 'tty';
|
|
13
|
-
import 'url';
|
|
13
|
+
import 'node:url';
|
|
14
|
+
import 'path';
|
|
14
15
|
import 'local-pkg';
|
|
15
16
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
16
|
-
import './chunk-runtime-rpc.
|
|
17
|
-
import './chunk-utils-timers.
|
|
17
|
+
import './chunk-runtime-rpc.54d72169.js';
|
|
18
|
+
import './chunk-utils-timers.715da787.js';
|
|
19
|
+
import 'node:fs';
|
|
20
|
+
import './chunk-utils-source-map.59ba6b0a.js';
|
|
18
21
|
import 'fs';
|
|
19
|
-
import './chunk-utils-source-map.5bbb50cd.js';
|
|
20
22
|
import './spy.js';
|
|
21
23
|
import 'tinyspy';
|
|
22
24
|
import 'perf_hooks';
|
|
23
25
|
import './chunk-integrations-coverage.befed097.js';
|
|
24
|
-
import './chunk-runtime-error.
|
|
26
|
+
import './chunk-runtime-error.f5c8aaf2.js';
|
|
25
27
|
import 'vite-node/source-map';
|
|
26
|
-
import './chunk-env-node.
|
|
27
|
-
import 'console';
|
|
28
|
+
import './chunk-env-node.b3664da2.js';
|
|
29
|
+
import 'node:console';
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { promises } from 'fs';
|
|
1
|
+
import { promises } from 'node:fs';
|
|
2
2
|
import { c as createBirpc } from './vendor-index.783e7f3e.js';
|
|
3
3
|
import require$$0$1 from 'stream';
|
|
4
4
|
import require$$0 from 'zlib';
|
|
@@ -8,11 +8,13 @@ import require$$5 from 'crypto';
|
|
|
8
8
|
import require$$2 from 'events';
|
|
9
9
|
import require$$1 from 'https';
|
|
10
10
|
import require$$2$1 from 'http';
|
|
11
|
-
import
|
|
12
|
-
import { A as API_PATH } from './chunk-utils-env.
|
|
13
|
-
import './chunk-typecheck-constants.
|
|
11
|
+
import require$$7 from 'url';
|
|
12
|
+
import { A as API_PATH } from './chunk-utils-env.3fdc1793.js';
|
|
13
|
+
import './chunk-typecheck-constants.06e1fe5b.js';
|
|
14
14
|
import 'tty';
|
|
15
|
+
import 'node:url';
|
|
15
16
|
import 'path';
|
|
17
|
+
import 'node:path';
|
|
16
18
|
import 'local-pkg';
|
|
17
19
|
|
|
18
20
|
async function getModuleGraph(ctx, id) {
|
|
@@ -2567,7 +2569,7 @@ const http$1 = require$$2$1;
|
|
|
2567
2569
|
const net = require$$3;
|
|
2568
2570
|
const tls = require$$4;
|
|
2569
2571
|
const { randomBytes, createHash: createHash$1 } = require$$5;
|
|
2570
|
-
const { URL: URL$1 } =
|
|
2572
|
+
const { URL: URL$1 } = require$$7;
|
|
2571
2573
|
|
|
2572
2574
|
const PerMessageDeflate$1 = permessageDeflate;
|
|
2573
2575
|
const Receiver = receiver;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import require$$0 from 'fs';
|
|
2
|
+
import g from 'path';
|
|
3
3
|
import util from 'util';
|
|
4
|
-
import
|
|
5
|
-
import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.
|
|
4
|
+
import require$$0$2 from 'child_process';
|
|
5
|
+
import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.7a2cebfe.js';
|
|
6
6
|
import { o as onetime$1 } from './vendor-index.9c919048.js';
|
|
7
|
-
import require$$0 from 'os';
|
|
7
|
+
import require$$0$1 from 'os';
|
|
8
8
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
9
9
|
import 'assert';
|
|
10
10
|
import 'events';
|
|
@@ -205,8 +205,8 @@ const pLocate$1 = async (iterable, tester, options) => {
|
|
|
205
205
|
|
|
206
206
|
var pLocate_1 = pLocate$1;
|
|
207
207
|
|
|
208
|
-
const path$1 =
|
|
209
|
-
const fs$1 =
|
|
208
|
+
const path$1 = g;
|
|
209
|
+
const fs$1 = require$$0;
|
|
210
210
|
const {promisify: promisify$1} = util;
|
|
211
211
|
const pLocate = pLocate_1;
|
|
212
212
|
|
|
@@ -275,7 +275,7 @@ locatePath.exports.sync = (paths, options) => {
|
|
|
275
275
|
|
|
276
276
|
var pathExists = {exports: {}};
|
|
277
277
|
|
|
278
|
-
const fs =
|
|
278
|
+
const fs = require$$0;
|
|
279
279
|
const {promisify} = util;
|
|
280
280
|
|
|
281
281
|
const pAccess = promisify(fs.access);
|
|
@@ -299,7 +299,7 @@ pathExists.exports.sync = path => {
|
|
|
299
299
|
};
|
|
300
300
|
|
|
301
301
|
(function (module) {
|
|
302
|
-
const path =
|
|
302
|
+
const path = g;
|
|
303
303
|
const locatePath$1 = locatePath.exports;
|
|
304
304
|
const pathExists$1 = pathExists.exports;
|
|
305
305
|
|
|
@@ -411,7 +411,7 @@ var stripFinalNewline$1 = input => {
|
|
|
411
411
|
var npmRunPath$1 = {exports: {}};
|
|
412
412
|
|
|
413
413
|
(function (module) {
|
|
414
|
-
const path =
|
|
414
|
+
const path = g;
|
|
415
415
|
const pathKey$1 = pathKey.exports;
|
|
416
416
|
|
|
417
417
|
const npmRunPath = options => {
|
|
@@ -759,7 +759,7 @@ standard:"posix"};
|
|
|
759
759
|
const SIGRTMIN=34;
|
|
760
760
|
const SIGRTMAX=64;realtime.SIGRTMAX=SIGRTMAX;
|
|
761
761
|
|
|
762
|
-
Object.defineProperty(signals,"__esModule",{value:true});signals.getSignals=void 0;var _os$1=require$$0;
|
|
762
|
+
Object.defineProperty(signals,"__esModule",{value:true});signals.getSignals=void 0;var _os$1=require$$0$1;
|
|
763
763
|
|
|
764
764
|
var _core=core;
|
|
765
765
|
var _realtime$1=realtime;
|
|
@@ -794,7 +794,7 @@ const number=supported?constantSignal:defaultNumber;
|
|
|
794
794
|
return {name,number,description,supported,action,forced,standard};
|
|
795
795
|
};
|
|
796
796
|
|
|
797
|
-
Object.defineProperty(main,"__esModule",{value:true});main.signalsByNumber=main.signalsByName=void 0;var _os=require$$0;
|
|
797
|
+
Object.defineProperty(main,"__esModule",{value:true});main.signalsByNumber=main.signalsByName=void 0;var _os=require$$0$1;
|
|
798
798
|
|
|
799
799
|
var _signals=signals;
|
|
800
800
|
var _realtime=realtime;
|
|
@@ -1007,7 +1007,7 @@ stdio.exports.node = options => {
|
|
|
1007
1007
|
return [...stdio, 'ipc'];
|
|
1008
1008
|
};
|
|
1009
1009
|
|
|
1010
|
-
const os = require$$0;
|
|
1010
|
+
const os = require$$0$1;
|
|
1011
1011
|
const onExit = signalExit.exports;
|
|
1012
1012
|
|
|
1013
1013
|
const DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;
|
|
@@ -1341,8 +1341,8 @@ var command = {
|
|
|
1341
1341
|
parseCommand: parseCommand$1
|
|
1342
1342
|
};
|
|
1343
1343
|
|
|
1344
|
-
const path =
|
|
1345
|
-
const childProcess =
|
|
1344
|
+
const path = g;
|
|
1345
|
+
const childProcess = require$$0$2;
|
|
1346
1346
|
const crossSpawn = crossSpawn$1.exports;
|
|
1347
1347
|
const stripFinalNewline = stripFinalNewline$1;
|
|
1348
1348
|
const npmRunPath = npmRunPath$1.exports;
|
|
@@ -1623,12 +1623,12 @@ async function detectPackageManager(cwd = process.cwd()) {
|
|
|
1623
1623
|
const lockPath = await findUp(Object.keys(LOCKS), { cwd });
|
|
1624
1624
|
let packageJsonPath;
|
|
1625
1625
|
if (lockPath)
|
|
1626
|
-
packageJsonPath =
|
|
1626
|
+
packageJsonPath = g.resolve(lockPath, "../package.json");
|
|
1627
1627
|
else
|
|
1628
1628
|
packageJsonPath = await findUp("package.json", { cwd });
|
|
1629
|
-
if (packageJsonPath &&
|
|
1629
|
+
if (packageJsonPath && require$$0.existsSync(packageJsonPath)) {
|
|
1630
1630
|
try {
|
|
1631
|
-
const pkg = JSON.parse(
|
|
1631
|
+
const pkg = JSON.parse(require$$0.readFileSync(packageJsonPath, "utf8"));
|
|
1632
1632
|
if (typeof pkg.packageManager === "string") {
|
|
1633
1633
|
const [name, version] = pkg.packageManager.split("@");
|
|
1634
1634
|
if (name === "yarn" && parseInt(version) > 1)
|
|
@@ -1644,7 +1644,7 @@ async function detectPackageManager(cwd = process.cwd()) {
|
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
1646
|
if (!agent && lockPath)
|
|
1647
|
-
agent = LOCKS[
|
|
1647
|
+
agent = LOCKS[g.basename(lockPath)];
|
|
1648
1648
|
return agent;
|
|
1649
1649
|
}
|
|
1650
1650
|
async function installPackage(names, options = {}) {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { m as globalApis } from './chunk-utils-env.3fdc1793.js';
|
|
2
|
+
import { i as index } from './chunk-utils-import.afe2ffde.js';
|
|
3
|
+
import 'tty';
|
|
4
|
+
import 'node:url';
|
|
5
|
+
import 'path';
|
|
6
|
+
import './chunk-runtime-chain.4cd984be.js';
|
|
7
|
+
import 'util';
|
|
8
|
+
import 'chai';
|
|
9
|
+
import './chunk-typecheck-constants.06e1fe5b.js';
|
|
10
|
+
import 'node:path';
|
|
11
|
+
import 'local-pkg';
|
|
12
|
+
import './vendor-_commonjsHelpers.addc3445.js';
|
|
13
|
+
import './chunk-runtime-rpc.54d72169.js';
|
|
14
|
+
import './chunk-utils-timers.715da787.js';
|
|
15
|
+
import 'node:fs';
|
|
16
|
+
import './chunk-utils-source-map.59ba6b0a.js';
|
|
17
|
+
import 'fs';
|
|
18
|
+
import './spy.js';
|
|
19
|
+
import 'tinyspy';
|
|
20
|
+
|
|
21
|
+
function registerApiGlobally() {
|
|
22
|
+
globalApis.forEach((api) => {
|
|
23
|
+
globalThis[api] = index[api];
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { registerApiGlobally };
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { b as resolve } from './chunk-utils-env.
|
|
2
|
-
import { e as execa } from './vendor-index.
|
|
1
|
+
import { b as resolve } from './chunk-utils-env.3fdc1793.js';
|
|
2
|
+
import { e as execa } from './vendor-index.b2fdde54.js';
|
|
3
3
|
import 'tty';
|
|
4
|
-
import 'url';
|
|
4
|
+
import 'node:url';
|
|
5
5
|
import 'path';
|
|
6
|
-
import 'buffer';
|
|
6
|
+
import 'node:buffer';
|
|
7
|
+
import 'node:path';
|
|
8
|
+
import 'node:child_process';
|
|
9
|
+
import 'node:process';
|
|
10
|
+
import './vendor-index.7a2cebfe.js';
|
|
7
11
|
import 'child_process';
|
|
8
|
-
import 'process';
|
|
9
|
-
import './vendor-index.e1d4cf84.js';
|
|
10
12
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
11
13
|
import 'fs';
|
|
12
14
|
import 'assert';
|
|
13
15
|
import 'events';
|
|
16
|
+
import 'buffer';
|
|
14
17
|
import 'stream';
|
|
15
18
|
import 'util';
|
|
16
19
|
import 'os';
|
|
20
|
+
import 'node:os';
|
|
17
21
|
|
|
18
22
|
class VitestGit {
|
|
19
23
|
constructor(cwd) {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import util$1 from 'util';
|
|
2
2
|
import * as chai$2 from 'chai';
|
|
3
3
|
import { expect, AssertionError, util } from 'chai';
|
|
4
|
-
import { i as isObject, b as getCallLastIndex, s as slash, g as getWorkerState, c as getNames, d as assertTypes, e as getCurrentEnvironment, f as getFullName, o as objectAttr, n as noop, h as isRunningInTest, j as isRunningInBenchmark } from './chunk-typecheck-constants.
|
|
4
|
+
import { i as isObject, b as getCallLastIndex, s as slash, g as getWorkerState, c as getNames, d as assertTypes, e as getCurrentEnvironment, f as getFullName, o as objectAttr, n as noop, h as isRunningInTest, j as isRunningInBenchmark } from './chunk-typecheck-constants.06e1fe5b.js';
|
|
5
5
|
import { c as commonjsGlobal } from './vendor-_commonjsHelpers.addc3445.js';
|
|
6
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
7
|
-
import fs
|
|
8
|
-
import { j as join, d as dirname, p as picocolors } from './chunk-utils-env.
|
|
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.
|
|
10
|
-
import { a as posToNumber, n as numberToPos, l as lineSplitRE, p as parseStacktrace } from './chunk-utils-source-map.
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.54d72169.js';
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import { j as join, d as dirname, p as picocolors } from './chunk-utils-env.3fdc1793.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.715da787.js';
|
|
10
|
+
import { a as posToNumber, n as numberToPos, l as lineSplitRE, p as parseStacktrace } from './chunk-utils-source-map.59ba6b0a.js';
|
|
11
|
+
import { promises } from 'fs';
|
|
11
12
|
import { isMockFunction } from './spy.js';
|
|
12
13
|
|
|
13
14
|
function createChainable(keys, fn) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import util$1 from 'util';
|
|
2
2
|
import { util } from 'chai';
|
|
3
|
-
import { a as stringify } from './chunk-utils-timers.
|
|
4
|
-
import { x as deepClone, y as getType } from './chunk-typecheck-constants.
|
|
3
|
+
import { a as stringify } from './chunk-utils-timers.715da787.js';
|
|
4
|
+
import { x as deepClone, g as getWorkerState, y as getType } from './chunk-typecheck-constants.06e1fe5b.js';
|
|
5
5
|
|
|
6
6
|
const IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
|
|
7
7
|
const IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
@@ -79,10 +79,12 @@ function processError(err) {
|
|
|
79
79
|
const { replacedActual, replacedExpected } = replaceAsymmetricMatcher(clonedActual, clonedExpected);
|
|
80
80
|
err.actual = replacedActual;
|
|
81
81
|
err.expected = replacedExpected;
|
|
82
|
+
const workerState = getWorkerState();
|
|
83
|
+
const maxDiffSize = workerState.config.outputDiffMaxSize;
|
|
82
84
|
if (typeof err.expected !== "string")
|
|
83
|
-
err.expected = stringify(err.expected);
|
|
85
|
+
err.expected = stringify(err.expected, 10, { maxLength: maxDiffSize });
|
|
84
86
|
if (typeof err.actual !== "string")
|
|
85
|
-
err.actual = stringify(err.actual);
|
|
87
|
+
err.actual = stringify(err.actual, 10, { maxLength: maxDiffSize });
|
|
86
88
|
try {
|
|
87
89
|
if (typeof err.message === "string")
|
|
88
90
|
err.message = normalizeErrorMessage(err.message);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
2
|
+
import { isInternalRequest } from 'vite-node/utils';
|
|
2
3
|
import { normalizePath } from 'vite';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { b as resolve, e as distDir, g as isAbsolute, p as picocolors, d as dirname, j as join, c as basename, l as extname } from './chunk-utils-env.
|
|
4
|
+
import { i as isNodeBuiltin } from './vendor-index.2e96c50b.js';
|
|
5
|
+
import { g as getWorkerState, y as getType, K as getAllMockableProperties, e as getCurrentEnvironment } from './chunk-typecheck-constants.06e1fe5b.js';
|
|
6
|
+
import { existsSync, readdirSync } from 'node:fs';
|
|
7
|
+
import { b as resolve, e as distDir, g as isAbsolute, p as picocolors, d as dirname, j as join, c as basename, l as extname } from './chunk-utils-env.3fdc1793.js';
|
|
7
8
|
|
|
8
9
|
class RefTracker {
|
|
9
10
|
constructor() {
|
|
@@ -309,6 +310,12 @@ class VitestRunner extends ViteNodeRunner {
|
|
|
309
310
|
this.options = options;
|
|
310
311
|
this.mocker = new VitestMocker(this);
|
|
311
312
|
}
|
|
313
|
+
shouldResolveId(id, _importee) {
|
|
314
|
+
if (isInternalRequest(id))
|
|
315
|
+
return false;
|
|
316
|
+
const environment = getCurrentEnvironment();
|
|
317
|
+
return environment === "node" ? !isNodeBuiltin(id) : true;
|
|
318
|
+
}
|
|
312
319
|
async resolveUrl(id, importee) {
|
|
313
320
|
if (importee && importee.startsWith("mock:"))
|
|
314
321
|
importee = importee.slice(5);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as getWorkerState } from './chunk-typecheck-constants.
|
|
2
|
-
import { s as safeSetTimeout } from './chunk-utils-timers.
|
|
1
|
+
import { g as getWorkerState } from './chunk-typecheck-constants.06e1fe5b.js';
|
|
2
|
+
import { s as safeSetTimeout } from './chunk-utils-timers.715da787.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-utils-import.
|
|
4
|
-
import { g as getWorkerState, R as RealDate, t as toArray, l as relativePath, j as isRunningInBenchmark, p as partitionSuiteChildren, q as shuffle, u as hasTests, v as hasFailed, w as createDefer, f as getFullName } from './chunk-typecheck-constants.
|
|
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.
|
|
3
|
+
import { r as resetRunOnceCounter, i as index, v as vi, s as setCurrentTest } from './chunk-utils-import.afe2ffde.js';
|
|
4
|
+
import { g as getWorkerState, R as RealDate, t as toArray, l as relativePath, j as isRunningInBenchmark, p as partitionSuiteChildren, q as shuffle, u as hasTests, v as hasFailed, w as createDefer, f as getFullName } from './chunk-typecheck-constants.06e1fe5b.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.4cd984be.js';
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.54d72169.js';
|
|
7
|
+
import { p as processError } from './chunk-runtime-error.f5c8aaf2.js';
|
|
8
8
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
9
|
-
import { e as environments } from './chunk-env-node.
|
|
10
|
-
import { i as isNode, a as isBrowser } from './chunk-utils-env.
|
|
11
|
-
import { b as safeClearTimeout, s as safeSetTimeout } from './chunk-utils-timers.
|
|
9
|
+
import { e as environments } from './chunk-env-node.b3664da2.js';
|
|
10
|
+
import { i as isNode, a as isBrowser } from './chunk-utils-env.3fdc1793.js';
|
|
11
|
+
import { b as safeClearTimeout, s as safeSetTimeout } from './chunk-utils-timers.715da787.js';
|
|
12
12
|
|
|
13
13
|
let globalSetup = false;
|
|
14
14
|
async function setupGlobalEnv(config) {
|
|
@@ -29,7 +29,7 @@ async function setupGlobalEnv(config) {
|
|
|
29
29
|
await setupConsoleLogSpy();
|
|
30
30
|
}
|
|
31
31
|
if (config.globals)
|
|
32
|
-
(await import('./chunk-integrations-globals.
|
|
32
|
+
(await import('./chunk-integrations-globals.96914902.js')).registerApiGlobally();
|
|
33
33
|
}
|
|
34
34
|
function setupDefines(defines) {
|
|
35
35
|
for (const key in defines)
|
|
@@ -40,8 +40,8 @@ async function setupConsoleLogSpy() {
|
|
|
40
40
|
const stderrBuffer = /* @__PURE__ */ new Map();
|
|
41
41
|
const timers = /* @__PURE__ */ new Map();
|
|
42
42
|
const unknownTestId = "__vitest__unknown_test__";
|
|
43
|
-
const { Writable } = await import('stream');
|
|
44
|
-
const { Console } = await import('console');
|
|
43
|
+
const { Writable } = await import('node:stream');
|
|
44
|
+
const { Console } = await import('node:console');
|
|
45
45
|
function schedule(taskId) {
|
|
46
46
|
const timer = timers.get(taskId);
|
|
47
47
|
const { stdoutTime, stderrTime } = timer;
|
|
@@ -329,7 +329,7 @@ const callCleanupHooks = async (cleanups) => {
|
|
|
329
329
|
async function runTest(test) {
|
|
330
330
|
var _a, _b, _c;
|
|
331
331
|
if (test.mode !== "run") {
|
|
332
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
332
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.4cd984be.js').then(function (n) { return n.r; });
|
|
333
333
|
getSnapshotClient().skipTestSnapshots(test);
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
@@ -346,7 +346,7 @@ async function runTest(test) {
|
|
|
346
346
|
clearModuleMocks();
|
|
347
347
|
setCurrentTest(test);
|
|
348
348
|
if (isNode) {
|
|
349
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
349
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.4cd984be.js').then(function (n) { return n.r; });
|
|
350
350
|
await getSnapshotClient().setTest(test);
|
|
351
351
|
}
|
|
352
352
|
const workerState = getWorkerState();
|
|
@@ -409,7 +409,7 @@ async function runTest(test) {
|
|
|
409
409
|
console.error(test.result.error.message, test.result.error.stackStr);
|
|
410
410
|
setCurrentTest(void 0);
|
|
411
411
|
if (isNode) {
|
|
412
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
412
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.4cd984be.js').then(function (n) { return n.r; });
|
|
413
413
|
getSnapshotClient().clearTest();
|
|
414
414
|
}
|
|
415
415
|
test.result.duration = now() - start;
|
|
@@ -615,7 +615,7 @@ async function startTestsBrowser(paths, config) {
|
|
|
615
615
|
async function startTestsNode(paths, config) {
|
|
616
616
|
const files = await collectTests(paths, config);
|
|
617
617
|
rpc().onCollected(files);
|
|
618
|
-
const { getSnapshotClient } = await import('./chunk-runtime-chain.
|
|
618
|
+
const { getSnapshotClient } = await import('./chunk-runtime-chain.4cd984be.js').then(function (n) { return n.r; });
|
|
619
619
|
getSnapshotClient().clear();
|
|
620
620
|
await runFiles(files, config);
|
|
621
621
|
const coverage = await takeCoverageInsideWorker(config.coverage);
|