vitest 0.22.0 → 0.23.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/LICENSE.md +29 -29
- package/dist/browser.d.ts +5 -4
- package/dist/browser.mjs +12 -9
- package/dist/{chunk-api-setup.ecd02c18.mjs → chunk-api-setup.9e83ca0a.mjs} +92 -90
- package/dist/chunk-constants.6196597b.mjs +284 -0
- package/dist/{chunk-integrations-coverage.d205bd87.mjs → chunk-env-node.ceb43f1c.mjs} +31 -179
- package/dist/{chunk-install-pkg.3aa3eae6.mjs → chunk-install-pkg.e081fc1b.mjs} +3 -3
- package/dist/chunk-integrations-coverage.99c020eb.mjs +166 -0
- package/dist/chunk-integrations-globals.b1aa52c3.mjs +25 -0
- package/dist/{chunk-magic-string.efe26975.mjs → chunk-magic-string.56b2b543.mjs} +30 -10
- package/dist/{chunk-mock-date.debe9954.mjs → chunk-mock-date.f63a5ff2.mjs} +31 -193
- package/dist/{chunk-node-git.71b74da4.mjs → chunk-node-git.6f289b0a.mjs} +20 -16
- package/dist/{chunk-runtime-chain.6e363ba2.mjs → chunk-runtime-chain.8bfc559b.mjs} +507 -173
- package/dist/{chunk-runtime-error.975bd80a.mjs → chunk-runtime-error.252dd130.mjs} +206 -75
- package/dist/{chunk-runtime-hooks.4789e99d.mjs → chunk-runtime-hooks.c6b06bd8.mjs} +18 -12
- package/dist/{chunk-runtime-mocker.c91d29ce.mjs → chunk-runtime-mocker.d9690273.mjs} +19 -12
- package/dist/{chunk-runtime-rpc.29488183.mjs → chunk-runtime-rpc.48bd94e3.mjs} +1 -2
- package/dist/{chunk-utils-source-map.2a082ffd.mjs → chunk-utils-source-map.a1647f5f.mjs} +11 -5
- package/dist/{chunk-vite-node-client.d1ead698.mjs → chunk-vite-node-client.998e04d0.mjs} +92 -31
- package/dist/{chunk-vite-node-debug.ff1d2a9f.mjs → chunk-vite-node-debug.2d8a1dc3.mjs} +3 -4
- package/dist/{chunk-vite-node-externalize.3a38c8af.mjs → chunk-vite-node-externalize.3035bd5b.mjs} +515 -211
- package/dist/{chunk-vite-node-utils.d8e5ff7b.mjs → chunk-vite-node-utils.8a9b3014.mjs} +39 -41
- package/dist/cli-wrapper.mjs +54 -33
- package/dist/cli.mjs +31 -20
- package/dist/config.cjs +2 -2
- package/dist/config.d.ts +4 -3
- package/dist/config.mjs +2 -2
- package/dist/entry.mjs +20 -14
- package/dist/environments.d.ts +23 -0
- package/dist/environments.mjs +3 -0
- package/dist/{global-74489cc9.d.ts → global-ea084c9f.d.ts} +154 -24
- package/dist/{index-9eded9ec.d.ts → index-5f09f4d0.d.ts} +3 -2
- package/dist/index.d.ts +6 -5
- package/dist/index.mjs +7 -7
- package/dist/loader.mjs +5 -6
- package/dist/node.d.ts +5 -4
- package/dist/node.mjs +17 -16
- package/dist/suite.mjs +6 -6
- package/dist/vendor-index.0557b03a.mjs +147 -0
- package/dist/{vendor-index.9d9196cc.mjs → vendor-index.13e3bda3.mjs} +0 -0
- package/dist/{vendor-index.fbec8a81.mjs → vendor-index.4aeeb598.mjs} +2 -2
- package/dist/{vendor-index.2ae8040a.mjs → vendor-index.62ce5c33.mjs} +0 -0
- package/dist/{vendor-index.29636037.mjs → vendor-index.731a22f2.mjs} +0 -0
- package/dist/worker.mjs +20 -19
- package/package.json +18 -11
- package/dist/chunk-constants.d3f8437b.mjs +0 -38
- package/dist/chunk-integrations-globals.e81d2091.mjs +0 -27
- package/dist/chunk-utils-global.fa20c2f6.mjs +0 -5
- package/dist/vendor-picocolors.807856aa.mjs +0 -64
package/LICENSE.md
CHANGED
|
@@ -529,6 +529,35 @@ Repository: https://github.com/mathiasbynens/emoji-regex.git
|
|
|
529
529
|
|
|
530
530
|
---------------------------------------
|
|
531
531
|
|
|
532
|
+
## event-target-polyfill
|
|
533
|
+
License: MIT
|
|
534
|
+
By: Ben Lesh
|
|
535
|
+
Repository: git+https://github.com/benlesh/event-target-polyfill.git
|
|
536
|
+
|
|
537
|
+
> MIT License
|
|
538
|
+
>
|
|
539
|
+
> Copyright (c) 2020 Ben Lesh
|
|
540
|
+
>
|
|
541
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
542
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
543
|
+
> in the Software without restriction, including without limitation the rights
|
|
544
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
545
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
546
|
+
> furnished to do so, subject to the following conditions:
|
|
547
|
+
>
|
|
548
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
549
|
+
> copies or substantial portions of the Software.
|
|
550
|
+
>
|
|
551
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
552
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
553
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
554
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
555
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
556
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
557
|
+
> SOFTWARE.
|
|
558
|
+
|
|
559
|
+
---------------------------------------
|
|
560
|
+
|
|
532
561
|
## execa
|
|
533
562
|
License: MIT
|
|
534
563
|
By: Sindre Sorhus
|
|
@@ -1058,35 +1087,6 @@ Repository: git+https://github.com/isaacs/isexe.git
|
|
|
1058
1087
|
|
|
1059
1088
|
---------------------------------------
|
|
1060
1089
|
|
|
1061
|
-
## jsonc-parser
|
|
1062
|
-
License: MIT
|
|
1063
|
-
By: Microsoft Corporation
|
|
1064
|
-
Repository: https://github.com/microsoft/node-jsonc-parser
|
|
1065
|
-
|
|
1066
|
-
> The MIT License (MIT)
|
|
1067
|
-
>
|
|
1068
|
-
> Copyright (c) Microsoft
|
|
1069
|
-
>
|
|
1070
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1071
|
-
> of this software and associated documentation files (the "Software"), to deal
|
|
1072
|
-
> in the Software without restriction, including without limitation the rights
|
|
1073
|
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1074
|
-
> copies of the Software, and to permit persons to whom the Software is
|
|
1075
|
-
> furnished to do so, subject to the following conditions:
|
|
1076
|
-
>
|
|
1077
|
-
> The above copyright notice and this permission notice shall be included in all
|
|
1078
|
-
> copies or substantial portions of the Software.
|
|
1079
|
-
>
|
|
1080
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1081
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1082
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1083
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1084
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1085
|
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1086
|
-
> SOFTWARE.
|
|
1087
|
-
|
|
1088
|
-
---------------------------------------
|
|
1089
|
-
|
|
1090
1090
|
## kleur
|
|
1091
1091
|
License: MIT
|
|
1092
1092
|
By: Luke Edwards
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export { E as EnhancedSpy,
|
|
2
|
-
import { R as ResolvedConfig } from './global-
|
|
3
|
-
export {
|
|
1
|
+
export { E as EnhancedSpy, r as Mock, u as MockContext, q as MockInstance, v as Mocked, w as MockedClass, o as MockedFunction, p as MockedObject, S as SpyInstance, j as afterAll, l as afterEach, h as beforeAll, k as beforeEach, n as createExpect, e as describe, m as expect, i as it, d as suite, t as test } from './index-5f09f4d0.js';
|
|
2
|
+
import { R as ResolvedConfig } from './global-ea084c9f.js';
|
|
3
|
+
export { L as AfterSuiteRunMeta, A as ApiConfig, Y as ArgumentsType, X as Arrayable, P as Awaitable, ae as BaseCoverageOptions, ak as BenchFunction, ai as Benchmark, al as BenchmarkAPI, aj as BenchmarkResult, ah as BenchmarkUserOptions, B as BuiltinEnvironment, C as CSSModuleScopeStrategy, a0 as Constructable, ag as CoverageC8Options, af as CoverageIstanbulOptions, ac as CoverageOptions, a9 as CoverageProvider, aa as CoverageProviderModule, ab as CoverageReporter, _ as DeepMerge, D as DoneCallback, a3 as Environment, E as EnvironmentOptions, a2 as EnvironmentReturn, a7 as ErrorWithDiff, a as File, n as HookCleanupCallback, H as HookListener, I as InlineConfig, J as JSDOMOptions, Z as MergeInsertions, a1 as ModuleCache, M as ModuleGraphData, $ as MutableArray, Q as Nullable, a8 as OnServerRestartHandler, a6 as ParsedStack, a5 as Position, b as Reporter, K as ResolveIdFunction, R as ResolvedConfig, ad as ResolvedCoverageOptions, d as RunMode, r as RuntimeContext, u as SnapshotData, x as SnapshotMatchOptions, y as SnapshotResult, w as SnapshotStateOptions, G as SnapshotSummary, v as SnapshotUpdateState, S as Suite, m as SuiteAPI, p as SuiteCollector, q as SuiteFactory, o as SuiteHooks, i as Task, f as TaskBase, g as TaskResult, T as TaskResultPack, e as TaskState, h as Test, l as TestAPI, s as TestContext, j as TestFunction, k as TestOptions, z as UncheckedSnapshot, U as UserConfig, a4 as UserConsoleLog, t as Vitest, V as VitestEnvironment, c as VitestRunMode, W as WorkerContext, O as WorkerGlobalState, N as WorkerRPC } from './global-ea084c9f.js';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
|
7
|
+
export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench';
|
|
7
8
|
import 'tinyspy';
|
|
8
9
|
import 'vite';
|
|
9
|
-
import 'worker_threads';
|
|
10
10
|
import 'fs';
|
|
11
|
+
import 'worker_threads';
|
|
11
12
|
|
|
12
13
|
declare function startTests(paths: string[], config: ResolvedConfig): Promise<void>;
|
|
13
14
|
|
package/dist/browser.mjs
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
export { c as createExpect, d as describe,
|
|
2
|
-
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './chunk-runtime-hooks.
|
|
3
|
-
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-error.
|
|
1
|
+
export { c as createExpect, d as describe, e as expect, i as it, s as suite, t as test } from './chunk-runtime-chain.8bfc559b.mjs';
|
|
2
|
+
export { a as afterAll, d as afterEach, b as beforeAll, c as beforeEach } from './chunk-runtime-hooks.c6b06bd8.mjs';
|
|
3
|
+
export { a as setupGlobalEnv, s as startTests } from './chunk-runtime-error.252dd130.mjs';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
export { chai };
|
|
6
6
|
export { assert, should } from 'chai';
|
|
7
7
|
import 'util';
|
|
8
|
-
import './chunk-mock-date.
|
|
8
|
+
import './chunk-mock-date.f63a5ff2.mjs';
|
|
9
9
|
import 'path';
|
|
10
|
-
import './
|
|
10
|
+
import './chunk-constants.6196597b.mjs';
|
|
11
11
|
import 'tty';
|
|
12
|
+
import 'url';
|
|
12
13
|
import 'local-pkg';
|
|
13
14
|
import './vendor-_commonjsHelpers.4da45ef5.mjs';
|
|
14
|
-
import './chunk-runtime-rpc.
|
|
15
|
-
import './chunk-utils-global.fa20c2f6.mjs';
|
|
15
|
+
import './chunk-runtime-rpc.48bd94e3.mjs';
|
|
16
16
|
import './chunk-utils-timers.b48455ed.mjs';
|
|
17
17
|
import 'fs';
|
|
18
|
-
import './chunk-utils-source-map.
|
|
18
|
+
import './chunk-utils-source-map.a1647f5f.mjs';
|
|
19
19
|
import './spy.mjs';
|
|
20
20
|
import 'tinyspy';
|
|
21
|
-
import '
|
|
21
|
+
import 'perf_hooks';
|
|
22
|
+
import './chunk-integrations-coverage.99c020eb.mjs';
|
|
23
|
+
import './chunk-env-node.ceb43f1c.mjs';
|
|
24
|
+
import 'console';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises } from 'fs';
|
|
2
|
-
import { c as createBirpc } from './chunk-vite-node-client.
|
|
2
|
+
import { c as createBirpc } from './chunk-vite-node-client.998e04d0.mjs';
|
|
3
3
|
import require$$0$1 from 'stream';
|
|
4
4
|
import require$$0 from 'zlib';
|
|
5
5
|
import require$$3 from 'net';
|
|
@@ -9,19 +9,18 @@ import require$$2 from 'events';
|
|
|
9
9
|
import require$$1 from 'https';
|
|
10
10
|
import require$$2$1 from 'http';
|
|
11
11
|
import url from 'url';
|
|
12
|
-
import { A as API_PATH } from './chunk-constants.
|
|
13
|
-
import {
|
|
12
|
+
import { A as API_PATH } from './chunk-constants.6196597b.mjs';
|
|
13
|
+
import { i as interpretSourcePos, p as parseStacktrace } from './chunk-utils-source-map.a1647f5f.mjs';
|
|
14
14
|
import 'module';
|
|
15
15
|
import 'vm';
|
|
16
|
-
import './chunk-
|
|
16
|
+
import './chunk-vite-node-utils.8a9b3014.mjs';
|
|
17
17
|
import 'path';
|
|
18
|
-
import './vendor-picocolors.807856aa.mjs';
|
|
19
|
-
import 'tty';
|
|
20
|
-
import 'local-pkg';
|
|
21
|
-
import './chunk-vite-node-utils.d8e5ff7b.mjs';
|
|
22
18
|
import 'assert';
|
|
23
19
|
import 'util';
|
|
24
20
|
import 'debug';
|
|
21
|
+
import 'tty';
|
|
22
|
+
import './chunk-mock-date.f63a5ff2.mjs';
|
|
23
|
+
import 'local-pkg';
|
|
25
24
|
|
|
26
25
|
/*! (c) 2020 Andrea Giammarchi */
|
|
27
26
|
|
|
@@ -4418,94 +4417,97 @@ function setup(ctx) {
|
|
|
4418
4417
|
});
|
|
4419
4418
|
});
|
|
4420
4419
|
function setupClient(ws) {
|
|
4421
|
-
const rpc = createBirpc(
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4420
|
+
const rpc = createBirpc(
|
|
4421
|
+
{
|
|
4422
|
+
async onWatcherStart() {
|
|
4423
|
+
await ctx.report("onWatcherStart");
|
|
4424
|
+
},
|
|
4425
|
+
async onFinished() {
|
|
4426
|
+
await ctx.report("onFinished");
|
|
4427
|
+
},
|
|
4428
|
+
async onCollected(files) {
|
|
4429
|
+
ctx.state.collectFiles(files);
|
|
4430
|
+
await ctx.report("onCollected", files);
|
|
4431
|
+
},
|
|
4432
|
+
async onTaskUpdate(packs) {
|
|
4433
|
+
ctx.state.updateTasks(packs);
|
|
4434
|
+
await ctx.report("onTaskUpdate", packs);
|
|
4435
|
+
},
|
|
4436
|
+
getFiles() {
|
|
4437
|
+
return ctx.state.getFiles();
|
|
4438
|
+
},
|
|
4439
|
+
async getPaths() {
|
|
4440
|
+
return await ctx.state.getPaths();
|
|
4441
|
+
},
|
|
4442
|
+
readFile(id) {
|
|
4443
|
+
return promises.readFile(id, "utf-8");
|
|
4444
|
+
},
|
|
4445
|
+
writeFile(id, content) {
|
|
4446
|
+
return promises.writeFile(id, content, "utf-8");
|
|
4447
|
+
},
|
|
4448
|
+
async rerun(files) {
|
|
4449
|
+
await ctx.rerunFiles(files);
|
|
4450
|
+
},
|
|
4451
|
+
getConfig() {
|
|
4452
|
+
return ctx.config;
|
|
4453
|
+
},
|
|
4454
|
+
async getTransformResult(id) {
|
|
4455
|
+
const result = await ctx.vitenode.transformRequest(id);
|
|
4456
|
+
if (result) {
|
|
4457
|
+
try {
|
|
4458
|
+
result.source = result.source || await promises.readFile(id, "utf-8");
|
|
4459
|
+
} catch {
|
|
4460
|
+
}
|
|
4461
|
+
return result;
|
|
4460
4462
|
}
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
return seen.get(mod);
|
|
4476
|
-
let id2 = clearId(mod.id);
|
|
4477
|
-
seen.set(mod, id2);
|
|
4478
|
-
const rewrote = await ctx.vitenode.shouldExternalize(id2);
|
|
4479
|
-
if (rewrote) {
|
|
4480
|
-
id2 = rewrote;
|
|
4481
|
-
externalized.add(id2);
|
|
4463
|
+
},
|
|
4464
|
+
async getModuleGraph(id) {
|
|
4465
|
+
const graph = {};
|
|
4466
|
+
const externalized = /* @__PURE__ */ new Set();
|
|
4467
|
+
const inlined = /* @__PURE__ */ new Set();
|
|
4468
|
+
function clearId(id2) {
|
|
4469
|
+
return (id2 == null ? void 0 : id2.replace(/\?v=\w+$/, "")) || "";
|
|
4470
|
+
}
|
|
4471
|
+
async function get(mod, seen = /* @__PURE__ */ new Map()) {
|
|
4472
|
+
if (!mod || !mod.id)
|
|
4473
|
+
return;
|
|
4474
|
+
if (seen.has(mod))
|
|
4475
|
+
return seen.get(mod);
|
|
4476
|
+
let id2 = clearId(mod.id);
|
|
4482
4477
|
seen.set(mod, id2);
|
|
4483
|
-
|
|
4484
|
-
|
|
4478
|
+
const rewrote = await ctx.vitenode.shouldExternalize(id2);
|
|
4479
|
+
if (rewrote) {
|
|
4480
|
+
id2 = rewrote;
|
|
4481
|
+
externalized.add(id2);
|
|
4482
|
+
seen.set(mod, id2);
|
|
4483
|
+
} else {
|
|
4484
|
+
inlined.add(id2);
|
|
4485
|
+
}
|
|
4486
|
+
const mods = Array.from(mod.importedModules).filter((i) => i.id && !i.id.includes("/vitest/dist/"));
|
|
4487
|
+
graph[id2] = (await Promise.all(mods.map((m) => get(m, seen)))).filter(Boolean);
|
|
4488
|
+
return id2;
|
|
4485
4489
|
}
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4490
|
+
await get(ctx.server.moduleGraph.getModuleById(id));
|
|
4491
|
+
return {
|
|
4492
|
+
graph,
|
|
4493
|
+
externalized: Array.from(externalized),
|
|
4494
|
+
inlined: Array.from(inlined)
|
|
4495
|
+
};
|
|
4496
|
+
},
|
|
4497
|
+
updateSnapshot(file) {
|
|
4498
|
+
if (!file)
|
|
4499
|
+
return ctx.updateSnapshot();
|
|
4500
|
+
return ctx.updateSnapshot([file.filepath]);
|
|
4489
4501
|
}
|
|
4490
|
-
await get(ctx.server.moduleGraph.getModuleById(id));
|
|
4491
|
-
return {
|
|
4492
|
-
graph,
|
|
4493
|
-
externalized: Array.from(externalized),
|
|
4494
|
-
inlined: Array.from(inlined)
|
|
4495
|
-
};
|
|
4496
4502
|
},
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4503
|
+
{
|
|
4504
|
+
post: (msg) => ws.send(msg),
|
|
4505
|
+
on: (fn) => ws.on("message", fn),
|
|
4506
|
+
eventNames: ["onUserConsoleLog", "onFinished", "onCollected"],
|
|
4507
|
+
serialize: stringify,
|
|
4508
|
+
deserialize: parse$3
|
|
4501
4509
|
}
|
|
4502
|
-
|
|
4503
|
-
post: (msg) => ws.send(msg),
|
|
4504
|
-
on: (fn) => ws.on("message", fn),
|
|
4505
|
-
eventNames: ["onUserConsoleLog", "onFinished", "onCollected"],
|
|
4506
|
-
serialize: stringify,
|
|
4507
|
-
deserialize: parse$3
|
|
4508
|
-
});
|
|
4510
|
+
);
|
|
4509
4511
|
clients.set(ws, rpc);
|
|
4510
4512
|
ws.on("close", () => {
|
|
4511
4513
|
clients.delete(ws);
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import require$$0 from 'tty';
|
|
2
|
+
import url from 'url';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
var picocolors = {exports: {}};
|
|
6
|
+
|
|
7
|
+
let tty = require$$0;
|
|
8
|
+
|
|
9
|
+
let isColorSupported =
|
|
10
|
+
!("NO_COLOR" in process.env || process.argv.includes("--no-color")) &&
|
|
11
|
+
("FORCE_COLOR" in process.env ||
|
|
12
|
+
process.argv.includes("--color") ||
|
|
13
|
+
process.platform === "win32" ||
|
|
14
|
+
(tty.isatty(1) && process.env.TERM !== "dumb") ||
|
|
15
|
+
"CI" in process.env);
|
|
16
|
+
|
|
17
|
+
let formatter =
|
|
18
|
+
(open, close, replace = open) =>
|
|
19
|
+
input => {
|
|
20
|
+
let string = "" + input;
|
|
21
|
+
let index = string.indexOf(close, open.length);
|
|
22
|
+
return ~index
|
|
23
|
+
? open + replaceClose(string, close, replace, index) + close
|
|
24
|
+
: open + string + close
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
let replaceClose = (string, close, replace, index) => {
|
|
28
|
+
let start = string.substring(0, index) + replace;
|
|
29
|
+
let end = string.substring(index + close.length);
|
|
30
|
+
let nextIndex = end.indexOf(close);
|
|
31
|
+
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
let createColors = (enabled = isColorSupported) => ({
|
|
35
|
+
isColorSupported: enabled,
|
|
36
|
+
reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String,
|
|
37
|
+
bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String,
|
|
38
|
+
dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String,
|
|
39
|
+
italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String,
|
|
40
|
+
underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String,
|
|
41
|
+
inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String,
|
|
42
|
+
hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String,
|
|
43
|
+
strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String,
|
|
44
|
+
black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String,
|
|
45
|
+
red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String,
|
|
46
|
+
green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String,
|
|
47
|
+
yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String,
|
|
48
|
+
blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String,
|
|
49
|
+
magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String,
|
|
50
|
+
cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String,
|
|
51
|
+
white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String,
|
|
52
|
+
gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String,
|
|
53
|
+
bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String,
|
|
54
|
+
bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String,
|
|
55
|
+
bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String,
|
|
56
|
+
bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String,
|
|
57
|
+
bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String,
|
|
58
|
+
bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String,
|
|
59
|
+
bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String,
|
|
60
|
+
bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
picocolors.exports = createColors();
|
|
64
|
+
picocolors.exports.createColors = createColors;
|
|
65
|
+
|
|
66
|
+
function normalizeWindowsPath(input = "") {
|
|
67
|
+
if (!input.includes("\\")) {
|
|
68
|
+
return input;
|
|
69
|
+
}
|
|
70
|
+
return input.replace(/\\/g, "/");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const _UNC_REGEX = /^[/][/]/;
|
|
74
|
+
const _UNC_DRIVE_REGEX = /^[/][/]([.]{1,2}[/])?([a-zA-Z]):[/]/;
|
|
75
|
+
const _IS_ABSOLUTE_RE = /^\/|^\\|^[a-zA-Z]:[/\\]/;
|
|
76
|
+
const sep = "/";
|
|
77
|
+
const delimiter = ":";
|
|
78
|
+
const normalize = function(path2) {
|
|
79
|
+
if (path2.length === 0) {
|
|
80
|
+
return ".";
|
|
81
|
+
}
|
|
82
|
+
path2 = normalizeWindowsPath(path2);
|
|
83
|
+
const isUNCPath = path2.match(_UNC_REGEX);
|
|
84
|
+
const hasUNCDrive = isUNCPath && path2.match(_UNC_DRIVE_REGEX);
|
|
85
|
+
const isPathAbsolute = isAbsolute(path2);
|
|
86
|
+
const trailingSeparator = path2[path2.length - 1] === "/";
|
|
87
|
+
path2 = normalizeString(path2, !isPathAbsolute);
|
|
88
|
+
if (path2.length === 0) {
|
|
89
|
+
if (isPathAbsolute) {
|
|
90
|
+
return "/";
|
|
91
|
+
}
|
|
92
|
+
return trailingSeparator ? "./" : ".";
|
|
93
|
+
}
|
|
94
|
+
if (trailingSeparator) {
|
|
95
|
+
path2 += "/";
|
|
96
|
+
}
|
|
97
|
+
if (isUNCPath) {
|
|
98
|
+
if (hasUNCDrive) {
|
|
99
|
+
return `//./${path2}`;
|
|
100
|
+
}
|
|
101
|
+
return `//${path2}`;
|
|
102
|
+
}
|
|
103
|
+
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
104
|
+
};
|
|
105
|
+
const join = function(...args) {
|
|
106
|
+
if (args.length === 0) {
|
|
107
|
+
return ".";
|
|
108
|
+
}
|
|
109
|
+
let joined;
|
|
110
|
+
for (let i = 0; i < args.length; ++i) {
|
|
111
|
+
const arg = args[i];
|
|
112
|
+
if (arg.length > 0) {
|
|
113
|
+
if (joined === void 0) {
|
|
114
|
+
joined = arg;
|
|
115
|
+
} else {
|
|
116
|
+
joined += `/${arg}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (joined === void 0) {
|
|
121
|
+
return ".";
|
|
122
|
+
}
|
|
123
|
+
return normalize(joined);
|
|
124
|
+
};
|
|
125
|
+
const resolve = function(...args) {
|
|
126
|
+
args = args.map((arg) => normalizeWindowsPath(arg));
|
|
127
|
+
let resolvedPath = "";
|
|
128
|
+
let resolvedAbsolute = false;
|
|
129
|
+
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
130
|
+
const path2 = i >= 0 ? args[i] : process.cwd();
|
|
131
|
+
if (path2.length === 0) {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
resolvedPath = `${path2}/${resolvedPath}`;
|
|
135
|
+
resolvedAbsolute = isAbsolute(path2);
|
|
136
|
+
}
|
|
137
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
138
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
139
|
+
return `/${resolvedPath}`;
|
|
140
|
+
}
|
|
141
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
142
|
+
};
|
|
143
|
+
function normalizeString(path2, allowAboveRoot) {
|
|
144
|
+
let res = "";
|
|
145
|
+
let lastSegmentLength = 0;
|
|
146
|
+
let lastSlash = -1;
|
|
147
|
+
let dots = 0;
|
|
148
|
+
let char = null;
|
|
149
|
+
for (let i = 0; i <= path2.length; ++i) {
|
|
150
|
+
if (i < path2.length) {
|
|
151
|
+
char = path2[i];
|
|
152
|
+
} else if (char === "/") {
|
|
153
|
+
break;
|
|
154
|
+
} else {
|
|
155
|
+
char = "/";
|
|
156
|
+
}
|
|
157
|
+
if (char === "/") {
|
|
158
|
+
if (lastSlash === i - 1 || dots === 1) ; else if (dots === 2) {
|
|
159
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
160
|
+
if (res.length > 2) {
|
|
161
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
162
|
+
if (lastSlashIndex === -1) {
|
|
163
|
+
res = "";
|
|
164
|
+
lastSegmentLength = 0;
|
|
165
|
+
} else {
|
|
166
|
+
res = res.slice(0, lastSlashIndex);
|
|
167
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
168
|
+
}
|
|
169
|
+
lastSlash = i;
|
|
170
|
+
dots = 0;
|
|
171
|
+
continue;
|
|
172
|
+
} else if (res.length !== 0) {
|
|
173
|
+
res = "";
|
|
174
|
+
lastSegmentLength = 0;
|
|
175
|
+
lastSlash = i;
|
|
176
|
+
dots = 0;
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (allowAboveRoot) {
|
|
181
|
+
res += res.length > 0 ? "/.." : "..";
|
|
182
|
+
lastSegmentLength = 2;
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
if (res.length > 0) {
|
|
186
|
+
res += `/${path2.slice(lastSlash + 1, i)}`;
|
|
187
|
+
} else {
|
|
188
|
+
res = path2.slice(lastSlash + 1, i);
|
|
189
|
+
}
|
|
190
|
+
lastSegmentLength = i - lastSlash - 1;
|
|
191
|
+
}
|
|
192
|
+
lastSlash = i;
|
|
193
|
+
dots = 0;
|
|
194
|
+
} else if (char === "." && dots !== -1) {
|
|
195
|
+
++dots;
|
|
196
|
+
} else {
|
|
197
|
+
dots = -1;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return res;
|
|
201
|
+
}
|
|
202
|
+
const isAbsolute = function(p) {
|
|
203
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
204
|
+
};
|
|
205
|
+
const toNamespacedPath = function(p) {
|
|
206
|
+
return normalizeWindowsPath(p);
|
|
207
|
+
};
|
|
208
|
+
const extname = function(p) {
|
|
209
|
+
return path.posix.extname(normalizeWindowsPath(p));
|
|
210
|
+
};
|
|
211
|
+
const relative = function(from, to) {
|
|
212
|
+
return path.posix.relative(normalizeWindowsPath(from), normalizeWindowsPath(to));
|
|
213
|
+
};
|
|
214
|
+
const dirname = function(p) {
|
|
215
|
+
return path.posix.dirname(normalizeWindowsPath(p));
|
|
216
|
+
};
|
|
217
|
+
const format = function(p) {
|
|
218
|
+
return normalizeWindowsPath(path.posix.format(p));
|
|
219
|
+
};
|
|
220
|
+
const basename = function(p, ext) {
|
|
221
|
+
return path.posix.basename(normalizeWindowsPath(p), ext);
|
|
222
|
+
};
|
|
223
|
+
const parse = function(p) {
|
|
224
|
+
return path.posix.parse(normalizeWindowsPath(p));
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const _path = /*#__PURE__*/Object.freeze({
|
|
228
|
+
__proto__: null,
|
|
229
|
+
sep: sep,
|
|
230
|
+
delimiter: delimiter,
|
|
231
|
+
normalize: normalize,
|
|
232
|
+
join: join,
|
|
233
|
+
resolve: resolve,
|
|
234
|
+
normalizeString: normalizeString,
|
|
235
|
+
isAbsolute: isAbsolute,
|
|
236
|
+
toNamespacedPath: toNamespacedPath,
|
|
237
|
+
extname: extname,
|
|
238
|
+
relative: relative,
|
|
239
|
+
dirname: dirname,
|
|
240
|
+
format: format,
|
|
241
|
+
basename: basename,
|
|
242
|
+
parse: parse
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
({
|
|
246
|
+
..._path
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
const rootDir = resolve(url.fileURLToPath(import.meta.url), "../../");
|
|
250
|
+
const distDir = resolve(url.fileURLToPath(import.meta.url), "../../dist");
|
|
251
|
+
const defaultPort = 51204;
|
|
252
|
+
const EXIT_CODE_RESTART = 43;
|
|
253
|
+
const API_PATH = "/__vitest_api__";
|
|
254
|
+
const configFiles = [
|
|
255
|
+
"vitest.config.ts",
|
|
256
|
+
"vitest.config.mts",
|
|
257
|
+
"vitest.config.cts",
|
|
258
|
+
"vitest.config.js",
|
|
259
|
+
"vitest.config.mjs",
|
|
260
|
+
"vitest.config.cjs",
|
|
261
|
+
"vite.config.ts",
|
|
262
|
+
"vite.config.mts",
|
|
263
|
+
"vite.config.cts",
|
|
264
|
+
"vite.config.js",
|
|
265
|
+
"vite.config.mjs",
|
|
266
|
+
"vite.config.cjs"
|
|
267
|
+
];
|
|
268
|
+
const globalApis = [
|
|
269
|
+
"suite",
|
|
270
|
+
"test",
|
|
271
|
+
"describe",
|
|
272
|
+
"it",
|
|
273
|
+
"chai",
|
|
274
|
+
"expect",
|
|
275
|
+
"assert",
|
|
276
|
+
"vitest",
|
|
277
|
+
"vi",
|
|
278
|
+
"beforeAll",
|
|
279
|
+
"afterAll",
|
|
280
|
+
"beforeEach",
|
|
281
|
+
"afterEach"
|
|
282
|
+
];
|
|
283
|
+
|
|
284
|
+
export { API_PATH as A, EXIT_CODE_RESTART as E, resolve as a, basename as b, distDir as c, dirname as d, rootDir as e, configFiles as f, defaultPort as g, extname as h, isAbsolute as i, join as j, globalApis as k, normalize as n, picocolors as p, relative as r, toNamespacedPath as t };
|