vitest 0.29.3 → 0.29.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +502 -1
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +3 -4
- package/dist/child.js +4 -5
- package/dist/{chunk-api-setup.d9eccaeb.js → chunk-api-setup.ac7748ac.js} +9 -12
- package/dist/{chunk-constants.797d3ebf.js → chunk-constants.bc18a549.js} +1 -7
- package/dist/{chunk-install-pkg.1dfb2c00.js → chunk-install-pkg.1d7d489b.js} +12 -12
- package/dist/{chunk-integrations-globals.85aeb216.js → chunk-integrations-globals.a473e88a.js} +8 -10
- package/dist/{chunk-integrations-run-once.9012f759.js → chunk-integrations-run-once.a2b4758b.js} +1 -1
- package/dist/{chunk-integrations-utils.5243a0d7.js → chunk-integrations-utils.d7c85bd9.js} +2 -2
- package/dist/{chunk-node-pkg.7627b6fc.js → chunk-node-pkg.e9461f8a.js} +6975 -3598
- package/dist/chunk-paths.e36446b4.js +7 -0
- package/dist/{chunk-runtime-mocker.07568540.js → chunk-runtime-mocker.344fec90.js} +5 -4
- package/dist/{chunk-runtime-rpc.1232904e.js → chunk-runtime-rpc.1b5714dc.js} +1 -1
- package/dist/{chunk-runtime-setup.ccad6a47.js → chunk-runtime-setup.a49dc2f9.js} +2 -2
- package/dist/{chunk-utils-global.727b6d25.js → chunk-utils-env.04ffbef7.js} +7 -4
- package/dist/{chunk-utils-import.8bd22905.js → chunk-utils-import.39ffe9c5.js} +3 -3
- package/dist/cli-wrapper.js +1 -4
- package/dist/cli.js +15 -15
- package/dist/config.cjs +5 -0
- package/dist/config.d.ts +7 -3
- package/dist/config.js +5 -0
- package/dist/coverage.d.ts +2 -2
- package/dist/entry.js +7 -8
- package/dist/environments.d.ts +2 -2
- package/dist/index.d.ts +4 -5
- package/dist/index.js +6 -7
- package/dist/loader.js +1 -2
- package/dist/node.d.ts +3 -3
- package/dist/node.js +15 -15
- package/dist/runners.d.ts +2 -2
- package/dist/runners.js +3 -4
- package/dist/{types-5872e574.d.ts → types-fafda418.d.ts} +84 -14
- package/dist/{chunk-magic-string.3a794426.js → vendor-magic-string.es.b3bc5745.js} +82 -1
- package/dist/worker.js +4 -5
- package/package.json +18 -8
- package/dist/chunk-utils-env.860d90c2.js +0 -6
|
@@ -10,18 +10,17 @@ import require$$2 from 'events';
|
|
|
10
10
|
import require$$1 from 'https';
|
|
11
11
|
import require$$2$1 from 'http';
|
|
12
12
|
import require$$7 from 'url';
|
|
13
|
-
import { A as API_PATH } from './chunk-constants.
|
|
14
|
-
import './chunk-utils-
|
|
13
|
+
import { A as API_PATH } from './chunk-constants.bc18a549.js';
|
|
14
|
+
import './chunk-utils-env.04ffbef7.js';
|
|
15
15
|
import { a as parseErrorStacktrace } from './chunk-utils-tasks.b41c8284.js';
|
|
16
|
-
import 'node:url';
|
|
17
16
|
import 'pathe';
|
|
18
|
-
import './chunk-utils-env.860d90c2.js';
|
|
19
17
|
import 'std-env';
|
|
20
18
|
import '@vitest/runner/utils';
|
|
21
19
|
import '@vitest/utils';
|
|
22
20
|
import './chunk-utils-base.81f83dbd.js';
|
|
23
21
|
|
|
24
22
|
async function getModuleGraph(ctx, id) {
|
|
23
|
+
var _a;
|
|
25
24
|
const graph = {};
|
|
26
25
|
const externalized = /* @__PURE__ */ new Set();
|
|
27
26
|
const inlined = /* @__PURE__ */ new Set();
|
|
@@ -47,7 +46,7 @@ async function getModuleGraph(ctx, id) {
|
|
|
47
46
|
graph[id2] = (await Promise.all(mods.map((m) => get(m, seen)))).filter(Boolean);
|
|
48
47
|
return id2;
|
|
49
48
|
}
|
|
50
|
-
await get(ctx.server.moduleGraph.getModuleById(id));
|
|
49
|
+
await get(ctx.server.moduleGraph.getModuleById(id) || ((_a = ctx.browser) == null ? void 0 : _a.moduleGraph.getModuleById(id)));
|
|
51
50
|
return {
|
|
52
51
|
graph,
|
|
53
52
|
externalized: Array.from(externalized),
|
|
@@ -4483,11 +4482,11 @@ function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
|
|
|
4483
4482
|
}
|
|
4484
4483
|
}
|
|
4485
4484
|
|
|
4486
|
-
function setup(ctx) {
|
|
4485
|
+
function setup(ctx, server) {
|
|
4487
4486
|
var _a;
|
|
4488
4487
|
const wss = new websocketServer({ noServer: true });
|
|
4489
4488
|
const clients = /* @__PURE__ */ new Map();
|
|
4490
|
-
(_a = ctx.server.httpServer) == null ? void 0 : _a.on("upgrade", (request, socket, head) => {
|
|
4489
|
+
(_a = (server || ctx.server).httpServer) == null ? void 0 : _a.on("upgrade", (request, socket, head) => {
|
|
4491
4490
|
if (!request.url)
|
|
4492
4491
|
return;
|
|
4493
4492
|
const { pathname } = new URL(request.url, "http://localhost");
|
|
@@ -4501,11 +4500,9 @@ function setup(ctx) {
|
|
|
4501
4500
|
function setupClient(ws) {
|
|
4502
4501
|
const rpc = createBirpc(
|
|
4503
4502
|
{
|
|
4504
|
-
async
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
async onFinished() {
|
|
4508
|
-
await ctx.report("onFinished");
|
|
4503
|
+
async onDone(testId) {
|
|
4504
|
+
var _a2, _b;
|
|
4505
|
+
await ((_b = (_a2 = ctx.browserProvider) == null ? void 0 : _a2.testFinished) == null ? void 0 : _b.call(_a2, testId));
|
|
4509
4506
|
},
|
|
4510
4507
|
async onCollected(files) {
|
|
4511
4508
|
ctx.state.collectFiles(files);
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import url from 'node:url';
|
|
2
|
-
import { resolve } from 'pathe';
|
|
3
|
-
import { i as isNode } from './chunk-utils-env.860d90c2.js';
|
|
4
|
-
|
|
5
|
-
const rootDir = isNode ? resolve(url.fileURLToPath(import.meta.url), "../../") : import.meta.url;
|
|
6
|
-
const distDir = isNode ? resolve(url.fileURLToPath(import.meta.url), "../../dist") : import.meta.url;
|
|
7
1
|
const defaultPort = 51204;
|
|
8
2
|
const EXIT_CODE_RESTART = 43;
|
|
9
3
|
const API_PATH = "/__vitest_api__";
|
|
@@ -39,4 +33,4 @@ const globalApis = [
|
|
|
39
33
|
"afterEach"
|
|
40
34
|
];
|
|
41
35
|
|
|
42
|
-
export { API_PATH as A, EXIT_CODE_RESTART as E,
|
|
36
|
+
export { API_PATH as A, EXIT_CODE_RESTART as E, configFiles as c, defaultPort as d, globalApis as g };
|
|
@@ -3,7 +3,7 @@ import k from 'path';
|
|
|
3
3
|
import require$$0$1 from 'util';
|
|
4
4
|
import require$$0$3 from 'child_process';
|
|
5
5
|
import { p as pathKey, s as signalExit, m as mergeStream$1, g as getStream$1, c as crossSpawn$1 } from './vendor-index.2cbcdd1e.js';
|
|
6
|
-
import { o as onetime$1 } from './chunk-node-pkg.
|
|
6
|
+
import { o as onetime$1 } from './chunk-node-pkg.e9461f8a.js';
|
|
7
7
|
import require$$0$2 from 'os';
|
|
8
8
|
import 'node:buffer';
|
|
9
9
|
import 'node:path';
|
|
@@ -17,39 +17,39 @@ import 'events';
|
|
|
17
17
|
import 'buffer';
|
|
18
18
|
import 'stream';
|
|
19
19
|
import 'pathe';
|
|
20
|
-
import './chunk-constants.
|
|
21
|
-
import './chunk-utils-env.860d90c2.js';
|
|
22
|
-
import 'std-env';
|
|
20
|
+
import './chunk-constants.bc18a549.js';
|
|
23
21
|
import './chunk-integrations-coverage.e0a6acd2.js';
|
|
24
22
|
import 'local-pkg';
|
|
25
23
|
import './chunk-env-node.affdd278.js';
|
|
26
24
|
import 'node:console';
|
|
27
25
|
import 'picocolors';
|
|
26
|
+
import './chunk-utils-env.04ffbef7.js';
|
|
27
|
+
import 'std-env';
|
|
28
|
+
import '@vitest/runner/utils';
|
|
29
|
+
import '@vitest/utils';
|
|
28
30
|
import 'vite';
|
|
29
31
|
import 'node:fs';
|
|
32
|
+
import 'vite-node/utils';
|
|
30
33
|
import 'vite-node/client';
|
|
31
|
-
import 'vite-node/server';
|
|
32
|
-
import './chunk-utils-global.727b6d25.js';
|
|
33
|
-
import '@vitest/runner/utils';
|
|
34
|
-
import '@vitest/utils';
|
|
35
34
|
import 'node:fs/promises';
|
|
36
35
|
import 'source-map';
|
|
37
36
|
import 'module';
|
|
38
37
|
import 'acorn';
|
|
39
38
|
import 'acorn-walk';
|
|
39
|
+
import './chunk-utils-base.81f83dbd.js';
|
|
40
|
+
import 'crypto';
|
|
41
|
+
import './chunk-paths.e36446b4.js';
|
|
40
42
|
import 'node:v8';
|
|
41
43
|
import './vendor-index.783e7f3e.js';
|
|
42
|
-
import './chunk-utils-base.81f83dbd.js';
|
|
43
44
|
import 'node:worker_threads';
|
|
44
45
|
import 'tinypool';
|
|
45
46
|
import 'perf_hooks';
|
|
46
47
|
import './chunk-utils-tasks.b41c8284.js';
|
|
47
|
-
import 'crypto';
|
|
48
|
-
import 'vite-node/utils';
|
|
49
48
|
import '@vitest/utils/diff';
|
|
49
|
+
import 'vite-node/server';
|
|
50
|
+
import './vendor-magic-string.es.b3bc5745.js';
|
|
50
51
|
import 'node:module';
|
|
51
52
|
import 'node:crypto';
|
|
52
|
-
import './chunk-magic-string.3a794426.js';
|
|
53
53
|
import 'strip-literal';
|
|
54
54
|
import 'readline';
|
|
55
55
|
|
package/dist/{chunk-integrations-globals.85aeb216.js → chunk-integrations-globals.a473e88a.js}
RENAMED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
import { g as globalApis } from './chunk-constants.
|
|
2
|
-
import { i as index } from './chunk-integrations-utils.
|
|
3
|
-
import 'node:url';
|
|
4
|
-
import 'pathe';
|
|
5
|
-
import './chunk-utils-env.860d90c2.js';
|
|
6
|
-
import 'std-env';
|
|
1
|
+
import { g as globalApis } from './chunk-constants.bc18a549.js';
|
|
2
|
+
import { i as index } from './chunk-integrations-utils.d7c85bd9.js';
|
|
7
3
|
import '@vitest/runner';
|
|
8
|
-
import './chunk-utils-import.
|
|
4
|
+
import './chunk-utils-import.39ffe9c5.js';
|
|
9
5
|
import '@vitest/runner/utils';
|
|
10
6
|
import '@vitest/utils';
|
|
11
|
-
import './chunk-utils-
|
|
7
|
+
import './chunk-utils-env.04ffbef7.js';
|
|
8
|
+
import 'pathe';
|
|
9
|
+
import 'std-env';
|
|
12
10
|
import 'chai';
|
|
13
11
|
import './vendor-_commonjsHelpers.addc3445.js';
|
|
14
12
|
import '@vitest/expect';
|
|
15
|
-
import './chunk-runtime-rpc.
|
|
13
|
+
import './chunk-runtime-rpc.1b5714dc.js';
|
|
16
14
|
import './chunk-snapshot-env.a347d647.js';
|
|
17
15
|
import './chunk-utils-base.81f83dbd.js';
|
|
18
16
|
import './chunk-utils-tasks.b41c8284.js';
|
|
19
17
|
import 'util';
|
|
20
18
|
import '@vitest/spy';
|
|
21
|
-
import './chunk-integrations-run-once.
|
|
19
|
+
import './chunk-integrations-run-once.a2b4758b.js';
|
|
22
20
|
|
|
23
21
|
function registerApiGlobally() {
|
|
24
22
|
globalApis.forEach((api) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { suite, test, describe, it, beforeAll, beforeEach, afterAll, afterEach, onTestFailed } from '@vitest/runner';
|
|
2
|
-
import { b as bench, c as createExpect, g as globalExpect, v as vitest, a as vi } from './chunk-utils-import.
|
|
3
|
-
import { r as runOnce, i as isFirstRun } from './chunk-integrations-run-once.
|
|
2
|
+
import { b as bench, c as createExpect, g as globalExpect, v as vitest, a as vi } from './chunk-utils-import.39ffe9c5.js';
|
|
3
|
+
import { r as runOnce, i as isFirstRun } from './chunk-integrations-run-once.a2b4758b.js';
|
|
4
4
|
import * as chai from 'chai';
|
|
5
5
|
import { assert, should } from 'chai';
|
|
6
6
|
|