vitest 0.12.9 → 0.13.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/dist/{chunk-api-setup.010a6158.js → chunk-api-setup.8d604f90.js} +107 -51
- package/dist/{chunk-constants.9e9c5c75.js → chunk-constants.b0ea3b74.js} +1 -1
- package/dist/{chunk-defaults.0fce304d.js → chunk-defaults.e5ec89dd.js} +1 -1
- package/dist/{chunk-install-pkg.73b84ae1.js → chunk-install-pkg.e11db438.js} +1 -1
- package/dist/{chunk-integrations-globals.fda74a73.js → chunk-integrations-globals.1cc5e231.js} +7 -7
- package/dist/{chunk-runtime-chain.67ecb3a0.js → chunk-runtime-chain.46442ffe.js} +21 -10
- package/dist/{chunk-runtime-mocker.f99f69c3.js → chunk-runtime-mocker.e9fdf718.js} +3 -3
- package/dist/chunk-runtime-rpc.50765c8b.js +15 -0
- package/dist/{chunk-utils-global.2529a727.js → chunk-utils-global.550519fc.js} +28 -2
- package/dist/{chunk-utils-timers.b1b3dfa6.js → chunk-utils-source-map.19e9554e.js} +14 -11
- package/dist/{chunk-vite-node-externalize.42b0363f.js → chunk-vite-node-externalize.61cc47ef.js} +8761 -8770
- package/dist/{chunk-vite-node-utils.317f59c6.js → chunk-vite-node-utils.52235551.js} +4 -4
- package/dist/cli.js +17 -17
- package/dist/entry.js +6 -6
- package/dist/index.d.ts +61 -10
- package/dist/index.js +4 -4
- package/dist/node.d.ts +56 -0
- package/dist/node.js +20 -20
- package/dist/{vendor-entry.e4d01a65.js → vendor-entry.225630f2.js} +12 -12
- package/dist/{vendor-index.40be925a.js → vendor-index.22581bd4.js} +407 -407
- package/dist/worker.js +5 -5
- package/package.json +37 -37
- package/dist/chunk-runtime-rpc.5050afd6.js +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { builtinModules, createRequire } from 'module';
|
|
2
2
|
import { pathToFileURL, fileURLToPath as fileURLToPath$2, URL as URL$1 } from 'url';
|
|
3
3
|
import vm from 'vm';
|
|
4
|
-
import {
|
|
4
|
+
import { m as isAbsolute$2, l as resolve, j as join$2, I as extname$2, d as dirname$2 } from './chunk-utils-global.550519fc.js';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import fs, { realpathSync, statSync, Stats, promises, existsSync } from 'fs';
|
|
7
7
|
import assert from 'assert';
|
|
@@ -2776,7 +2776,7 @@ const compare$b = compare_1$1;
|
|
|
2776
2776
|
// - If no C has a prerelease and the LT.semver tuple, return false
|
|
2777
2777
|
// - Else return true
|
|
2778
2778
|
|
|
2779
|
-
const subset$1 = (sub, dom, options
|
|
2779
|
+
const subset$1 = (sub, dom, options) => {
|
|
2780
2780
|
if (sub === dom)
|
|
2781
2781
|
return true
|
|
2782
2782
|
|
|
@@ -7290,7 +7290,7 @@ const compare = compare_1;
|
|
|
7290
7290
|
// - If no C has a prerelease and the LT.semver tuple, return false
|
|
7291
7291
|
// - Else return true
|
|
7292
7292
|
|
|
7293
|
-
const subset = (sub, dom, options
|
|
7293
|
+
const subset = (sub, dom, options) => {
|
|
7294
7294
|
if (sub === dom)
|
|
7295
7295
|
return true
|
|
7296
7296
|
|
|
@@ -7948,7 +7948,7 @@ const defaultFindOptions = {
|
|
|
7948
7948
|
return null;
|
|
7949
7949
|
}
|
|
7950
7950
|
};
|
|
7951
|
-
async function findNearestFile(filename, _options
|
|
7951
|
+
async function findNearestFile(filename, _options) {
|
|
7952
7952
|
const options = { ...defaultFindOptions, ..._options };
|
|
7953
7953
|
const basePath = resolve(options.startingFrom);
|
|
7954
7954
|
const leadingSlash = basePath[0] === "/";
|
package/dist/cli.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { p as picocolors } from './chunk-utils-global.
|
|
3
|
-
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.
|
|
2
|
+
import { p as picocolors } from './chunk-utils-global.550519fc.js';
|
|
3
|
+
import { v as version, s as startVitest, d as divider } from './chunk-vite-node-externalize.61cc47ef.js';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'local-pkg';
|
|
6
6
|
import 'path';
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
7
|
+
import 'vite';
|
|
8
|
+
import 'url';
|
|
9
9
|
import 'process';
|
|
10
|
-
import './vendor-index.40be925a.js';
|
|
11
|
-
import './vendor-_commonjsHelpers.addc3445.js';
|
|
12
10
|
import 'fs';
|
|
13
|
-
import '
|
|
14
|
-
import 'stream';
|
|
15
|
-
import 'util';
|
|
16
|
-
import 'url';
|
|
17
|
-
import 'os';
|
|
18
|
-
import 'vite';
|
|
19
|
-
import './chunk-constants.9e9c5c75.js';
|
|
11
|
+
import './chunk-constants.b0ea3b74.js';
|
|
20
12
|
import 'readline';
|
|
21
|
-
import '
|
|
13
|
+
import 'os';
|
|
14
|
+
import 'util';
|
|
15
|
+
import 'stream';
|
|
16
|
+
import './vendor-_commonjsHelpers.addc3445.js';
|
|
17
|
+
import './chunk-vite-node-utils.52235551.js';
|
|
22
18
|
import 'module';
|
|
23
19
|
import 'vm';
|
|
20
|
+
import 'assert';
|
|
24
21
|
import 'debug';
|
|
25
|
-
import './chunk-defaults.
|
|
22
|
+
import './chunk-defaults.e5ec89dd.js';
|
|
26
23
|
import 'worker_threads';
|
|
27
24
|
import 'tinypool';
|
|
28
25
|
import 'perf_hooks';
|
|
29
|
-
import './chunk-utils-
|
|
26
|
+
import './chunk-utils-source-map.19e9554e.js';
|
|
27
|
+
import './vendor-index.22581bd4.js';
|
|
28
|
+
import 'child_process';
|
|
29
|
+
import 'buffer';
|
|
30
30
|
import './chunk-magic-string.41232190.js';
|
|
31
31
|
import './vendor-index.405e58ef.js';
|
|
32
32
|
|
|
@@ -641,7 +641,7 @@ class CAC extends EventEmitter {
|
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
643
|
|
|
644
|
-
const cac = (name
|
|
644
|
+
const cac = (name) => new CAC(name);
|
|
645
645
|
|
|
646
646
|
const cli = cac("vitest");
|
|
647
647
|
cli.version(version).option("-r, --root <path>", "root path").option("-c, --config <path>", "path to config file").option("-u, --update", "update snapshot").option("-w, --watch", "watch mode").option("-t, --testNamePattern <pattern>", "run tests with full names matching the specified pattern").option("--dir <path>", "base directory to scan for the test files").option("--ui", "enable UI").option("--open", "open UI automatically (default: !process.env.CI))").option("--api [api]", "serve API, available options: --api.port <port>, --api.host [host] and --api.strictPort").option("--threads", "enabled threads (default: true)").option("--silent", "silent console output from tests").option("--isolate", "isolate environment for each test file (default: true)").option("--reporter <name>", "reporter").option("--outputTruncateLength <length>", "diff output length").option("--outputFile <filename/-s>", "write test results to a file when the --reporter=json or --reporter=junit option is also specified, use cac's dot notation for individual outputs of mutliple reporters").option("--coverage", "use c8 for coverage").option("--run", "do not watch").option("--mode <name>", "override Vite mode (default: test)").option("--globals", "inject apis globally").option("--dom", "mock browser api with happy-dom").option("--environment <env>", "runner environment (default: node)").option("--passWithNoTests", "pass when no tests found").option("--allowOnly", "Allow tests and suites that are marked as only (default: !process.env.CI)").option("--changed [since]", "Run tests that are affected by the changed files (default: false)").help();
|
package/dist/entry.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { r as run } from './vendor-entry.
|
|
1
|
+
export { r as run } from './vendor-entry.225630f2.js';
|
|
2
2
|
import 'fs';
|
|
3
|
-
import './chunk-utils-global.
|
|
3
|
+
import './chunk-utils-global.550519fc.js';
|
|
4
4
|
import 'tty';
|
|
5
5
|
import 'local-pkg';
|
|
6
6
|
import 'path';
|
|
7
|
-
import './chunk-runtime-chain.
|
|
7
|
+
import './chunk-runtime-chain.46442ffe.js';
|
|
8
8
|
import 'chai';
|
|
9
9
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
10
|
-
import './chunk-runtime-rpc.
|
|
11
|
-
import './chunk-utils-
|
|
10
|
+
import './chunk-runtime-rpc.50765c8b.js';
|
|
11
|
+
import './chunk-utils-source-map.19e9554e.js';
|
|
12
12
|
import './chunk-integrations-spy.bee66426.js';
|
|
13
13
|
import 'tinyspy';
|
|
14
14
|
import 'util';
|
|
15
|
-
import './chunk-defaults.
|
|
15
|
+
import './chunk-defaults.e5ec89dd.js';
|
|
16
16
|
import 'module';
|
|
17
17
|
import 'url';
|
package/dist/index.d.ts
CHANGED
|
@@ -1265,6 +1265,53 @@ declare namespace jestMatcherUtils {
|
|
|
1265
1265
|
};
|
|
1266
1266
|
}
|
|
1267
1267
|
|
|
1268
|
+
/**
|
|
1269
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
1270
|
+
*
|
|
1271
|
+
* This source code is licensed under the MIT license found in the
|
|
1272
|
+
* LICENSE file in the root directory of this source tree.
|
|
1273
|
+
*/
|
|
1274
|
+
|
|
1275
|
+
interface SnapshotReturnOptions {
|
|
1276
|
+
actual: string;
|
|
1277
|
+
count: number;
|
|
1278
|
+
expected?: string;
|
|
1279
|
+
key: string;
|
|
1280
|
+
pass: boolean;
|
|
1281
|
+
}
|
|
1282
|
+
interface SaveStatus {
|
|
1283
|
+
deleted: boolean;
|
|
1284
|
+
saved: boolean;
|
|
1285
|
+
}
|
|
1286
|
+
declare class SnapshotState {
|
|
1287
|
+
testFilePath: string;
|
|
1288
|
+
snapshotPath: string;
|
|
1289
|
+
private _counters;
|
|
1290
|
+
private _dirty;
|
|
1291
|
+
private _updateSnapshot;
|
|
1292
|
+
private _snapshotData;
|
|
1293
|
+
private _initialData;
|
|
1294
|
+
private _inlineSnapshots;
|
|
1295
|
+
private _uncheckedKeys;
|
|
1296
|
+
private _snapshotFormat;
|
|
1297
|
+
added: number;
|
|
1298
|
+
expand: boolean;
|
|
1299
|
+
matched: number;
|
|
1300
|
+
unmatched: number;
|
|
1301
|
+
updated: number;
|
|
1302
|
+
constructor(testFilePath: string, snapshotPath: string, options: SnapshotStateOptions);
|
|
1303
|
+
markSnapshotsAsCheckedForTest(testName: string): void;
|
|
1304
|
+
private _getInlineSnapshotStack;
|
|
1305
|
+
private _addSnapshot;
|
|
1306
|
+
clear(): void;
|
|
1307
|
+
save(): Promise<SaveStatus>;
|
|
1308
|
+
getUncheckedCount(): number;
|
|
1309
|
+
getUncheckedKeys(): Array<string>;
|
|
1310
|
+
removeUncheckedKeys(): void;
|
|
1311
|
+
match({ testName, received, key, inlineSnapshot, isInline, error, }: SnapshotMatchOptions): SnapshotReturnOptions;
|
|
1312
|
+
pack(): Promise<SnapshotResult>;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1268
1315
|
declare type Tester = (a: any, b: any) => boolean | undefined;
|
|
1269
1316
|
interface MatcherState {
|
|
1270
1317
|
assertionCalls: number;
|
|
@@ -1279,6 +1326,7 @@ interface MatcherState {
|
|
|
1279
1326
|
isExpectingAssertionsError?: Error | null;
|
|
1280
1327
|
isNot: boolean;
|
|
1281
1328
|
promise: string;
|
|
1329
|
+
snapshotState: SnapshotState;
|
|
1282
1330
|
suppressedErrors: Array<Error>;
|
|
1283
1331
|
testPath?: string;
|
|
1284
1332
|
utils: typeof jestMatcherUtils & {
|
|
@@ -1400,16 +1448,13 @@ declare global {
|
|
|
1400
1448
|
|
|
1401
1449
|
declare type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never;
|
|
1402
1450
|
declare type ReturnType$1<T> = T extends (...args: any) => infer R ? R : never;
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
* Call the remote function and wait for the result.
|
|
1406
|
-
*/
|
|
1407
|
-
(...args: ArgumentsType<T>): Promise<Awaited<ReturnType$1<T>>>;
|
|
1451
|
+
declare type PromisifyFn<T> = ReturnType$1<T> extends Promise<any> ? T : (...args: ArgumentsType<T>) => Promise<Awaited<ReturnType$1<T>>>;
|
|
1452
|
+
declare type BirpcFn<T> = PromisifyFn<T> & {
|
|
1408
1453
|
/**
|
|
1409
1454
|
* Send event without asking for response
|
|
1410
1455
|
*/
|
|
1411
1456
|
asEvent(...args: ArgumentsType<T>): void;
|
|
1412
|
-
}
|
|
1457
|
+
};
|
|
1413
1458
|
declare type BirpcReturn<RemoteFunctions> = {
|
|
1414
1459
|
[K in keyof RemoteFunctions]: BirpcFn<RemoteFunctions[K]>;
|
|
1415
1460
|
};
|
|
@@ -1530,10 +1575,10 @@ declare const test: TestAPI<{}>;
|
|
|
1530
1575
|
declare const describe: SuiteAPI<{}>;
|
|
1531
1576
|
declare const it: TestAPI<{}>;
|
|
1532
1577
|
|
|
1533
|
-
declare const beforeAll: (fn: SuiteHooks['beforeAll'][0], timeout?: number
|
|
1534
|
-
declare const afterAll: (fn: SuiteHooks['afterAll'][0], timeout?: number
|
|
1535
|
-
declare const beforeEach: (fn: SuiteHooks['beforeEach'][0], timeout?: number
|
|
1536
|
-
declare const afterEach: (fn: SuiteHooks['afterEach'][0], timeout?: number
|
|
1578
|
+
declare const beforeAll: (fn: SuiteHooks['beforeAll'][0], timeout?: number) => void;
|
|
1579
|
+
declare const afterAll: (fn: SuiteHooks['afterAll'][0], timeout?: number) => void;
|
|
1580
|
+
declare const beforeEach: (fn: SuiteHooks['beforeEach'][0], timeout?: number) => void;
|
|
1581
|
+
declare const afterEach: (fn: SuiteHooks['afterEach'][0], timeout?: number) => void;
|
|
1537
1582
|
|
|
1538
1583
|
/**
|
|
1539
1584
|
* A simple wrapper for converting callback style to promise
|
|
@@ -1651,6 +1696,12 @@ declare class VitestUtils {
|
|
|
1651
1696
|
*/
|
|
1652
1697
|
stubGlobal(name: string | symbol | number, value: any): this;
|
|
1653
1698
|
resetModules(): this;
|
|
1699
|
+
/**
|
|
1700
|
+
* Wait for all imports to load.
|
|
1701
|
+
* Useful, if you have a synchronous call that starts
|
|
1702
|
+
* importing a module, that you cannot wait otherwise.
|
|
1703
|
+
*/
|
|
1704
|
+
dynamicImportSettled(): Promise<void>;
|
|
1654
1705
|
}
|
|
1655
1706
|
declare const vitest: VitestUtils;
|
|
1656
1707
|
declare const vi: VitestUtils;
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { c as afterAll, f as afterEach, b as beforeAll, e as beforeEach, g as createExpect, d as describe, h as expect, k as getRunningMode, a as isFirstRun, l as isWatchMode, i as it, r as runOnce, s as suite, t as test, j as vi, v as vitest, w as withCallback } from './chunk-runtime-chain.
|
|
1
|
+
export { c as afterAll, f as afterEach, b as beforeAll, e as beforeEach, g as createExpect, d as describe, h as expect, k as getRunningMode, a as isFirstRun, l as isWatchMode, i as it, r as runOnce, s as suite, t as test, j as vi, v as vitest, w as withCallback } from './chunk-runtime-chain.46442ffe.js';
|
|
2
2
|
export { assert, default as chai, should } from 'chai';
|
|
3
3
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
4
|
-
import './chunk-runtime-rpc.
|
|
5
|
-
import './chunk-utils-global.
|
|
4
|
+
import './chunk-runtime-rpc.50765c8b.js';
|
|
5
|
+
import './chunk-utils-global.550519fc.js';
|
|
6
6
|
import 'tty';
|
|
7
7
|
import 'local-pkg';
|
|
8
8
|
import 'path';
|
|
9
9
|
import 'fs';
|
|
10
|
-
import './chunk-utils-
|
|
10
|
+
import './chunk-utils-source-map.19e9554e.js';
|
|
11
11
|
import './chunk-integrations-spy.bee66426.js';
|
|
12
12
|
import 'tinyspy';
|
|
13
13
|
import 'util';
|
package/dist/node.d.ts
CHANGED
|
@@ -646,6 +646,14 @@ interface SnapshotStateOptions {
|
|
|
646
646
|
snapshotFormat?: OptionsReceived;
|
|
647
647
|
resolveSnapshotPath?: (path: string, extension: string) => string;
|
|
648
648
|
}
|
|
649
|
+
interface SnapshotMatchOptions {
|
|
650
|
+
testName: string;
|
|
651
|
+
received: unknown;
|
|
652
|
+
key?: string;
|
|
653
|
+
inlineSnapshot?: string;
|
|
654
|
+
isInline: boolean;
|
|
655
|
+
error?: Error;
|
|
656
|
+
}
|
|
649
657
|
interface SnapshotResult {
|
|
650
658
|
filepath: string;
|
|
651
659
|
added: number;
|
|
@@ -1076,6 +1084,53 @@ declare namespace jestMatcherUtils {
|
|
|
1076
1084
|
};
|
|
1077
1085
|
}
|
|
1078
1086
|
|
|
1087
|
+
/**
|
|
1088
|
+
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
1089
|
+
*
|
|
1090
|
+
* This source code is licensed under the MIT license found in the
|
|
1091
|
+
* LICENSE file in the root directory of this source tree.
|
|
1092
|
+
*/
|
|
1093
|
+
|
|
1094
|
+
interface SnapshotReturnOptions {
|
|
1095
|
+
actual: string;
|
|
1096
|
+
count: number;
|
|
1097
|
+
expected?: string;
|
|
1098
|
+
key: string;
|
|
1099
|
+
pass: boolean;
|
|
1100
|
+
}
|
|
1101
|
+
interface SaveStatus {
|
|
1102
|
+
deleted: boolean;
|
|
1103
|
+
saved: boolean;
|
|
1104
|
+
}
|
|
1105
|
+
declare class SnapshotState {
|
|
1106
|
+
testFilePath: string;
|
|
1107
|
+
snapshotPath: string;
|
|
1108
|
+
private _counters;
|
|
1109
|
+
private _dirty;
|
|
1110
|
+
private _updateSnapshot;
|
|
1111
|
+
private _snapshotData;
|
|
1112
|
+
private _initialData;
|
|
1113
|
+
private _inlineSnapshots;
|
|
1114
|
+
private _uncheckedKeys;
|
|
1115
|
+
private _snapshotFormat;
|
|
1116
|
+
added: number;
|
|
1117
|
+
expand: boolean;
|
|
1118
|
+
matched: number;
|
|
1119
|
+
unmatched: number;
|
|
1120
|
+
updated: number;
|
|
1121
|
+
constructor(testFilePath: string, snapshotPath: string, options: SnapshotStateOptions);
|
|
1122
|
+
markSnapshotsAsCheckedForTest(testName: string): void;
|
|
1123
|
+
private _getInlineSnapshotStack;
|
|
1124
|
+
private _addSnapshot;
|
|
1125
|
+
clear(): void;
|
|
1126
|
+
save(): Promise<SaveStatus>;
|
|
1127
|
+
getUncheckedCount(): number;
|
|
1128
|
+
getUncheckedKeys(): Array<string>;
|
|
1129
|
+
removeUncheckedKeys(): void;
|
|
1130
|
+
match({ testName, received, key, inlineSnapshot, isInline, error, }: SnapshotMatchOptions): SnapshotReturnOptions;
|
|
1131
|
+
pack(): Promise<SnapshotResult>;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1079
1134
|
declare type Tester = (a: any, b: any) => boolean | undefined;
|
|
1080
1135
|
interface MatcherState {
|
|
1081
1136
|
assertionCalls: number;
|
|
@@ -1090,6 +1145,7 @@ interface MatcherState {
|
|
|
1090
1145
|
isExpectingAssertionsError?: Error | null;
|
|
1091
1146
|
isNot: boolean;
|
|
1092
1147
|
promise: string;
|
|
1148
|
+
snapshotState: SnapshotState;
|
|
1093
1149
|
suppressedErrors: Array<Error>;
|
|
1094
1150
|
testPath?: string;
|
|
1095
1151
|
utils: typeof jestMatcherUtils & {
|
package/dist/node.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export { V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.
|
|
2
|
-
export { V as VitestRunner } from './chunk-runtime-mocker.
|
|
3
|
-
import '
|
|
4
|
-
import 'path';
|
|
5
|
-
import 'child_process';
|
|
6
|
-
import 'process';
|
|
7
|
-
import './vendor-index.40be925a.js';
|
|
8
|
-
import './vendor-_commonjsHelpers.addc3445.js';
|
|
9
|
-
import 'fs';
|
|
10
|
-
import 'assert';
|
|
11
|
-
import 'events';
|
|
12
|
-
import 'stream';
|
|
13
|
-
import 'util';
|
|
14
|
-
import 'url';
|
|
15
|
-
import 'os';
|
|
16
|
-
import './chunk-utils-global.2529a727.js';
|
|
1
|
+
export { V as VitestPlugin, c as createVitest, s as startVitest } from './chunk-vite-node-externalize.61cc47ef.js';
|
|
2
|
+
export { V as VitestRunner } from './chunk-runtime-mocker.e9fdf718.js';
|
|
3
|
+
import './chunk-utils-global.550519fc.js';
|
|
17
4
|
import 'tty';
|
|
18
5
|
import 'local-pkg';
|
|
6
|
+
import 'path';
|
|
19
7
|
import 'vite';
|
|
20
|
-
import '
|
|
8
|
+
import 'url';
|
|
9
|
+
import 'process';
|
|
10
|
+
import 'fs';
|
|
11
|
+
import './chunk-constants.b0ea3b74.js';
|
|
21
12
|
import 'readline';
|
|
22
|
-
import '
|
|
13
|
+
import 'os';
|
|
14
|
+
import 'util';
|
|
15
|
+
import 'stream';
|
|
16
|
+
import 'events';
|
|
17
|
+
import './vendor-_commonjsHelpers.addc3445.js';
|
|
18
|
+
import './chunk-vite-node-utils.52235551.js';
|
|
23
19
|
import 'module';
|
|
24
20
|
import 'vm';
|
|
21
|
+
import 'assert';
|
|
25
22
|
import 'debug';
|
|
26
|
-
import './chunk-defaults.
|
|
23
|
+
import './chunk-defaults.e5ec89dd.js';
|
|
27
24
|
import 'worker_threads';
|
|
28
25
|
import 'tinypool';
|
|
29
26
|
import 'perf_hooks';
|
|
30
|
-
import './chunk-utils-
|
|
27
|
+
import './chunk-utils-source-map.19e9554e.js';
|
|
28
|
+
import './vendor-index.22581bd4.js';
|
|
29
|
+
import 'child_process';
|
|
30
|
+
import 'buffer';
|
|
31
31
|
import './chunk-magic-string.41232190.js';
|
|
32
32
|
import './vendor-index.405e58ef.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import {
|
|
2
|
+
import { q as isNode, a as getWorkerState, f as safeClearTimeout, e as safeSetTimeout, t as toArray, N as clone, L as getType, o as relative, O as partitionSuiteChildren, P as hasTests, x as hasFailed, v as getFullName, r as resetModules } from './chunk-utils-global.550519fc.js';
|
|
3
3
|
import { importModule } from 'local-pkg';
|
|
4
|
-
import { s as suite, t as test, d as describe, i as it, r as runOnce, a as isFirstRun, b as beforeAll, c as afterAll, e as beforeEach, f as afterEach, w as withCallback, g as createExpect, h as expect, v as vitest, j as vi, k as getRunningMode, l as isWatchMode, m as resetRunOnceCounter, R as RealDate, n as clearCollectorContext, o as defaultSuite, p as setHooks, q as getHooks, u as collectorContext, x as getSnapshotClient, y as setState, z as getFn, A as getState } from './chunk-runtime-chain.
|
|
4
|
+
import { s as suite, t as test, d as describe, i as it, r as runOnce, a as isFirstRun, b as beforeAll, c as afterAll, e as beforeEach, f as afterEach, w as withCallback, g as createExpect, h as expect, v as vitest, j as vi, k as getRunningMode, l as isWatchMode, m as resetRunOnceCounter, R as RealDate, n as clearCollectorContext, o as defaultSuite, p as setHooks, q as getHooks, u as collectorContext, x as getSnapshotClient, y as setState, z as getFn, A as getState } from './chunk-runtime-chain.46442ffe.js';
|
|
5
5
|
import chai, { assert, should, util } from 'chai';
|
|
6
|
-
import { r as rpc } from './chunk-runtime-rpc.
|
|
7
|
-
import {
|
|
8
|
-
import { t as takeCoverage } from './chunk-defaults.0fce304d.js';
|
|
6
|
+
import { r as rpc } from './chunk-runtime-rpc.50765c8b.js';
|
|
7
|
+
import { t as takeCoverage } from './chunk-defaults.e5ec89dd.js';
|
|
9
8
|
import { format } from 'util';
|
|
9
|
+
import { s as stringify } from './chunk-utils-source-map.19e9554e.js';
|
|
10
10
|
|
|
11
11
|
var index = /*#__PURE__*/Object.freeze({
|
|
12
12
|
__proto__: null,
|
|
@@ -284,7 +284,7 @@ function getWindowKeys(global, win) {
|
|
|
284
284
|
function isClassLikeName(name) {
|
|
285
285
|
return name[0] === name[0].toUpperCase();
|
|
286
286
|
}
|
|
287
|
-
function populateGlobal(global, win, options
|
|
287
|
+
function populateGlobal(global, win, options) {
|
|
288
288
|
const { bindFunctions = false } = options;
|
|
289
289
|
const keys = getWindowKeys(global, win);
|
|
290
290
|
const originals = new Map(allowRewrite.map(([key]) => [key, global[key]]));
|
|
@@ -435,7 +435,7 @@ async function setupGlobalEnv(config) {
|
|
|
435
435
|
if (isNode)
|
|
436
436
|
await setupConsoleLogSpy();
|
|
437
437
|
if (config.globals)
|
|
438
|
-
(await import('./chunk-integrations-globals.
|
|
438
|
+
(await import('./chunk-integrations-globals.1cc5e231.js')).registerApiGlobally();
|
|
439
439
|
}
|
|
440
440
|
function setupDefines(defines) {
|
|
441
441
|
for (const key in defines)
|
|
@@ -451,8 +451,8 @@ async function setupConsoleLogSpy() {
|
|
|
451
451
|
function schedule(taskId) {
|
|
452
452
|
const timer = timers.get(taskId);
|
|
453
453
|
const { stdoutTime, stderrTime } = timer;
|
|
454
|
-
|
|
455
|
-
timer.timer =
|
|
454
|
+
safeClearTimeout(timer.timer);
|
|
455
|
+
timer.timer = safeSetTimeout(() => {
|
|
456
456
|
if (stderrTime < stdoutTime) {
|
|
457
457
|
sendStderr(taskId);
|
|
458
458
|
sendStdout(taskId);
|
|
@@ -835,13 +835,13 @@ let updateTimer;
|
|
|
835
835
|
let previousUpdate;
|
|
836
836
|
function updateTask(task) {
|
|
837
837
|
packs.set(task.id, task.result);
|
|
838
|
-
|
|
839
|
-
updateTimer =
|
|
838
|
+
safeClearTimeout(updateTimer);
|
|
839
|
+
updateTimer = safeSetTimeout(() => {
|
|
840
840
|
previousUpdate = sendTasksUpdate();
|
|
841
841
|
}, 10);
|
|
842
842
|
}
|
|
843
843
|
async function sendTasksUpdate() {
|
|
844
|
-
|
|
844
|
+
safeClearTimeout(updateTimer);
|
|
845
845
|
await previousUpdate;
|
|
846
846
|
if (packs.size) {
|
|
847
847
|
const p = rpc().onTaskUpdate(Array.from(packs));
|