vitest 4.0.0-beta.3 → 4.0.0-beta.4
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/browser.d.ts +1 -1
- package/dist/chunks/{base.D5_IXzht.js → base.BaCDDRPG.js} +1 -1
- package/dist/chunks/{browser.d.BSPEQIuf.d.ts → browser.d.BRP8scJf.d.ts} +1 -1
- package/dist/chunks/{cac.C30xmylc.js → cac.CY0IAxC4.js} +12 -6
- package/dist/chunks/{cli-api.DE98RCgs.js → cli-api.B8xRY9Zt.js} +10 -8
- package/dist/chunks/{coverage.OOpN1tMC.js → coverage.C84l9G-M.js} +40 -38
- package/dist/chunks/{creator.CJNzQTzZ.js → creator.yfA2ExGt.js} +63 -2
- package/dist/chunks/{index.B521nVV-.js → index.Bgo3tNWt.js} +23 -4
- package/dist/chunks/{index.Dppt57hu.js → index.CtUvr1c8.js} +1 -1
- package/dist/chunks/{plugin.d.CKCmge5g.d.ts → plugin.d.CLhMcYdD.d.ts} +1 -1
- package/dist/chunks/{reporters.d.BBuiUFDc.d.ts → reporters.d.DWg40D2B.d.ts} +98 -3
- package/dist/chunks/{rpc.CsFtxqeq.js → rpc.jnQO9F8a.js} +4 -8
- package/dist/chunks/{runBaseTests.Bbi_gTJQ.js → runBaseTests.DBVVLMSb.js} +3 -3
- package/dist/chunks/{worker.d.DyXSTmRq.d.ts → worker.d.C-1AbnVe.d.ts} +1 -1
- package/dist/chunks/{worker.d.xTcinSQw.d.ts → worker.d.zjyR34Pb.d.ts} +9 -0
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +5 -5
- package/dist/coverage.d.ts +3 -3
- package/dist/coverage.js +2 -2
- package/dist/execute.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/node.d.ts +8 -8
- package/dist/node.js +6 -6
- package/dist/reporters.d.ts +3 -3
- package/dist/runners.js +2 -2
- package/dist/worker.js +10 -4
- package/dist/workers/forks.js +1 -1
- package/dist/workers/runVmTests.js +3 -3
- package/dist/workers/threads.js +1 -1
- package/dist/workers.d.ts +2 -2
- package/dist/workers.js +3 -3
- package/package.json +15 -15
package/dist/browser.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import '@vitest/pretty-format';
|
|
|
11
11
|
import '@vitest/snapshot';
|
|
12
12
|
import 'vite-node/client';
|
|
13
13
|
import 'vite-node';
|
|
14
|
-
import './chunks/worker.d.
|
|
14
|
+
import './chunks/worker.d.zjyR34Pb.js';
|
|
15
15
|
import './chunks/environment.d.Bhm9oc0v.js';
|
|
16
16
|
import 'node:vm';
|
|
17
17
|
import '@vitest/mocker';
|
|
@@ -24,7 +24,7 @@ async function runBaseTests(method, state) {
|
|
|
24
24
|
const [executor, { run }] = await Promise.all([startViteNode({
|
|
25
25
|
state,
|
|
26
26
|
requestStubs: getDefaultRequestStubs()
|
|
27
|
-
}), import('./runBaseTests.
|
|
27
|
+
}), import('./runBaseTests.DBVVLMSb.js')]);
|
|
28
28
|
const fileSpecs = ctx.files.map((f) => typeof f === "string" ? {
|
|
29
29
|
filepath: f,
|
|
30
30
|
testLocations: void 0
|
|
@@ -619,7 +619,7 @@ class CAC extends EventEmitter {
|
|
|
619
619
|
|
|
620
620
|
const cac = (name = "") => new CAC(name);
|
|
621
621
|
|
|
622
|
-
var version = "4.0.0-beta.
|
|
622
|
+
var version = "4.0.0-beta.4";
|
|
623
623
|
|
|
624
624
|
const apiConfig = (port) => ({
|
|
625
625
|
port: {
|
|
@@ -886,7 +886,8 @@ const cliOptionsConfig = {
|
|
|
886
886
|
screenshotFailures: null,
|
|
887
887
|
locators: null,
|
|
888
888
|
testerHtmlPath: null,
|
|
889
|
-
instances: null
|
|
889
|
+
instances: null,
|
|
890
|
+
expect: null
|
|
890
891
|
}
|
|
891
892
|
},
|
|
892
893
|
pool: {
|
|
@@ -1234,11 +1235,16 @@ const benchCliOptionsConfig = {
|
|
|
1234
1235
|
}
|
|
1235
1236
|
};
|
|
1236
1237
|
const collectCliOptionsConfig = {
|
|
1238
|
+
...cliOptionsConfig,
|
|
1237
1239
|
json: {
|
|
1238
1240
|
description: "Print collected tests as JSON or write to a file (Default: false)",
|
|
1239
1241
|
argument: "[true/path]"
|
|
1240
1242
|
},
|
|
1241
|
-
filesOnly: { description: "Print only test files with out the test cases" }
|
|
1243
|
+
filesOnly: { description: "Print only test files with out the test cases" },
|
|
1244
|
+
changed: {
|
|
1245
|
+
description: "Print only tests that are affected by the changed files (default: `false`)",
|
|
1246
|
+
argument: "[since]"
|
|
1247
|
+
}
|
|
1242
1248
|
};
|
|
1243
1249
|
|
|
1244
1250
|
function addCommand(cli, name, option) {
|
|
@@ -1392,7 +1398,7 @@ async function start(mode, cliFilters, options) {
|
|
|
1392
1398
|
process.title = "node (vitest)";
|
|
1393
1399
|
} catch {}
|
|
1394
1400
|
try {
|
|
1395
|
-
const { startVitest } = await import('./cli-api.
|
|
1401
|
+
const { startVitest } = await import('./cli-api.B8xRY9Zt.js').then(function (n) { return n.f; });
|
|
1396
1402
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
1397
1403
|
if (!ctx.shouldKeepServer()) await ctx.exit();
|
|
1398
1404
|
} catch (e) {
|
|
@@ -1409,7 +1415,7 @@ async function init(project) {
|
|
|
1409
1415
|
console.error(/* @__PURE__ */ new Error("Only the \"browser\" project is supported. Use \"vitest init browser\" to create a new project."));
|
|
1410
1416
|
process.exit(1);
|
|
1411
1417
|
}
|
|
1412
|
-
const { create } = await import('./creator.
|
|
1418
|
+
const { create } = await import('./creator.yfA2ExGt.js');
|
|
1413
1419
|
await create();
|
|
1414
1420
|
}
|
|
1415
1421
|
async function collect(mode, cliFilters, options) {
|
|
@@ -1417,7 +1423,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
1417
1423
|
process.title = "node (vitest)";
|
|
1418
1424
|
} catch {}
|
|
1419
1425
|
try {
|
|
1420
|
-
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.
|
|
1426
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.B8xRY9Zt.js').then(function (n) { return n.f; });
|
|
1421
1427
|
const ctx = await prepareVitest(mode, {
|
|
1422
1428
|
...normalizeCliOptions(cliFilters, options),
|
|
1423
1429
|
watch: false,
|
|
@@ -11,8 +11,8 @@ import { generateFileHash, limitConcurrency, createFileTask, hasFailed, getTasks
|
|
|
11
11
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
12
12
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
13
13
|
import { ViteNodeServer } from 'vite-node/server';
|
|
14
|
-
import { v as version$1 } from './cac.
|
|
15
|
-
import { c as createBirpc } from './index.
|
|
14
|
+
import { v as version$1 } from './cac.CY0IAxC4.js';
|
|
15
|
+
import { c as createBirpc } from './index.Bgo3tNWt.js';
|
|
16
16
|
import { p as parse, s as stringify, d as printError, f as formatProjectName, w as withLabel, e as errorBanner, h as divider, i as generateCodeFrame, R as ReportersMap, B as BlobReporter, r as readBlobs, H as HangingProcessReporter } from './index.Bz6b0Ib7.js';
|
|
17
17
|
import require$$0$3 from 'events';
|
|
18
18
|
import require$$1$1 from 'https';
|
|
@@ -28,7 +28,7 @@ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
|
|
|
28
28
|
import { parseErrorStacktrace } from '@vitest/utils/source-map';
|
|
29
29
|
import crypto, { createHash } from 'node:crypto';
|
|
30
30
|
import { distDir, rootDir } from '../path.js';
|
|
31
|
-
import { h as hash, R as RandomSequencer, i as isPackageExists, g as getFilePoolName, d as isBrowserEnabled, r as resolveConfig, e as groupBy, f as getCoverageProvider, j as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.
|
|
31
|
+
import { h as hash, R as RandomSequencer, i as isPackageExists, g as getFilePoolName, d as isBrowserEnabled, r as resolveConfig, e as groupBy, f as getCoverageProvider, j as createPool, w as wildcardPatternToRegExp, a as resolveApiServerConfig, s as stdout } from './coverage.C84l9G-M.js';
|
|
32
32
|
import { c as convertTasksToEvents } from './typechecker.CMNPqJOo.js';
|
|
33
33
|
import { Console } from 'node:console';
|
|
34
34
|
import c from 'tinyrainbow';
|
|
@@ -5179,13 +5179,12 @@ function setup(ctx, _server) {
|
|
|
5179
5179
|
],
|
|
5180
5180
|
serialize: (data) => stringify(data, stringifyReplace),
|
|
5181
5181
|
deserialize: parse,
|
|
5182
|
-
|
|
5183
|
-
throw new Error(`[vitest-api]: Timeout calling "${functionName}"`);
|
|
5184
|
-
}
|
|
5182
|
+
timeout: -1
|
|
5185
5183
|
});
|
|
5186
5184
|
clients.set(ws, rpc);
|
|
5187
5185
|
ws.on("close", () => {
|
|
5188
5186
|
clients.delete(ws);
|
|
5187
|
+
rpc.$close(/* @__PURE__ */ new Error("[vitest-api]: Pending methods while closing rpc"));
|
|
5189
5188
|
});
|
|
5190
5189
|
}
|
|
5191
5190
|
ctx.reporters.push(new WebSocketReporter(ctx, wss, clients));
|
|
@@ -8248,6 +8247,11 @@ class StateManager {
|
|
|
8248
8247
|
reportedTasksMap = /* @__PURE__ */ new WeakMap();
|
|
8249
8248
|
blobs;
|
|
8250
8249
|
onUnhandledError;
|
|
8250
|
+
/** @internal */
|
|
8251
|
+
_data = {
|
|
8252
|
+
browserLastPort: defaultBrowserPort,
|
|
8253
|
+
timeoutIncreased: false
|
|
8254
|
+
};
|
|
8251
8255
|
constructor(options) {
|
|
8252
8256
|
this.onUnhandledError = options.onUnhandledError;
|
|
8253
8257
|
}
|
|
@@ -9172,7 +9176,6 @@ class Vitest {
|
|
|
9172
9176
|
/** @internal */ closingPromise;
|
|
9173
9177
|
/** @internal */ isCancelling = false;
|
|
9174
9178
|
/** @internal */ coreWorkspaceProject;
|
|
9175
|
-
/** @internal */ _browserLastPort = defaultBrowserPort;
|
|
9176
9179
|
/** @internal */ _browserSessions = new BrowserSessions();
|
|
9177
9180
|
/** @internal */ _cliOptions = {};
|
|
9178
9181
|
/** @internal */ reporters = [];
|
|
@@ -9260,7 +9263,6 @@ class Vitest {
|
|
|
9260
9263
|
this.watcher.unregisterWatcher();
|
|
9261
9264
|
clearTimeout(this._rerunTimer);
|
|
9262
9265
|
this.restartsCount += 1;
|
|
9263
|
-
this._browserLastPort = defaultBrowserPort;
|
|
9264
9266
|
this.pool?.close?.();
|
|
9265
9267
|
this.pool = void 0;
|
|
9266
9268
|
this.closingPromise = void 0;
|
|
@@ -22,7 +22,7 @@ import * as nodeos from 'node:os';
|
|
|
22
22
|
import nodeos__default from 'node:os';
|
|
23
23
|
import { isatty } from 'node:tty';
|
|
24
24
|
import EventEmitter from 'node:events';
|
|
25
|
-
import { c as createBirpc } from './index.
|
|
25
|
+
import { c as createBirpc } from './index.Bgo3tNWt.js';
|
|
26
26
|
import Tinypool$1, { Tinypool } from 'tinypool';
|
|
27
27
|
import { w as wrapSerializableConfig, a as Typechecker } from './typechecker.CMNPqJOo.js';
|
|
28
28
|
import { MessageChannel } from 'node:worker_threads';
|
|
@@ -2556,11 +2556,6 @@ function createChildProcessChannel$1(project, collect = false) {
|
|
|
2556
2556
|
message: "message",
|
|
2557
2557
|
response: "response"
|
|
2558
2558
|
};
|
|
2559
|
-
const channel = {
|
|
2560
|
-
onMessage: (callback) => emitter.on(events.message, callback),
|
|
2561
|
-
postMessage: (message) => emitter.emit(events.response, message),
|
|
2562
|
-
onClose: () => emitter.removeAllListeners()
|
|
2563
|
-
};
|
|
2564
2559
|
const rpc = createBirpc(createMethodsRPC(project, {
|
|
2565
2560
|
cacheFs: true,
|
|
2566
2561
|
collect
|
|
@@ -2584,11 +2579,17 @@ function createChildProcessChannel$1(project, collect = false) {
|
|
|
2584
2579
|
on(fn) {
|
|
2585
2580
|
emitter.on(events.response, fn);
|
|
2586
2581
|
},
|
|
2587
|
-
|
|
2588
|
-
throw new Error(`[vitest-pool]: Timeout calling "${functionName}"`);
|
|
2589
|
-
}
|
|
2582
|
+
timeout: -1
|
|
2590
2583
|
});
|
|
2591
2584
|
project.vitest.onCancel((reason) => rpc.onCancel(reason));
|
|
2585
|
+
const channel = {
|
|
2586
|
+
onMessage: (callback) => emitter.on(events.message, callback),
|
|
2587
|
+
postMessage: (message) => emitter.emit(events.response, message),
|
|
2588
|
+
onClose: () => {
|
|
2589
|
+
emitter.removeAllListeners();
|
|
2590
|
+
rpc.$close(/* @__PURE__ */ new Error("[vitest-pool]: Pending methods while closing rpc"));
|
|
2591
|
+
}
|
|
2592
|
+
};
|
|
2592
2593
|
return channel;
|
|
2593
2594
|
}
|
|
2594
2595
|
function createForksPool(vitest, { execArgv, env }) {
|
|
@@ -2717,14 +2718,18 @@ function createWorkerChannel$1(project, collect) {
|
|
|
2717
2718
|
on(fn) {
|
|
2718
2719
|
port.on("message", fn);
|
|
2719
2720
|
},
|
|
2720
|
-
|
|
2721
|
-
throw new Error(`[vitest-pool]: Timeout calling "${functionName}"`);
|
|
2722
|
-
}
|
|
2721
|
+
timeout: -1
|
|
2723
2722
|
});
|
|
2724
2723
|
project.vitest.onCancel((reason) => rpc.onCancel(reason));
|
|
2724
|
+
const onClose = () => {
|
|
2725
|
+
port.close();
|
|
2726
|
+
workerPort.close();
|
|
2727
|
+
rpc.$close(/* @__PURE__ */ new Error("[vitest-pool]: Pending methods while closing rpc"));
|
|
2728
|
+
};
|
|
2725
2729
|
return {
|
|
2726
2730
|
workerPort,
|
|
2727
|
-
port
|
|
2731
|
+
port,
|
|
2732
|
+
onClose
|
|
2728
2733
|
};
|
|
2729
2734
|
}
|
|
2730
2735
|
function createThreadsPool(vitest, { execArgv, env }) {
|
|
@@ -2757,11 +2762,7 @@ function createThreadsPool(vitest, { execArgv, env }) {
|
|
|
2757
2762
|
async function runFiles(project, config, files, environment, invalidates = []) {
|
|
2758
2763
|
const paths = files.map((f) => f.filepath);
|
|
2759
2764
|
vitest.state.clearFiles(project, paths);
|
|
2760
|
-
const { workerPort,
|
|
2761
|
-
const onClose = () => {
|
|
2762
|
-
port.close();
|
|
2763
|
-
workerPort.close();
|
|
2764
|
-
};
|
|
2765
|
+
const { workerPort, onClose } = createWorkerChannel$1(project, name === "collect");
|
|
2765
2766
|
const workerId = ++id;
|
|
2766
2767
|
const data = {
|
|
2767
2768
|
pool: "threads",
|
|
@@ -3013,15 +3014,10 @@ function stringToBytes(input, percentageReference) {
|
|
|
3013
3014
|
const suppressWarningsPath$1 = resolve(rootDir, "./suppress-warnings.cjs");
|
|
3014
3015
|
function createChildProcessChannel(project, collect) {
|
|
3015
3016
|
const emitter = new EventEmitter();
|
|
3016
|
-
const cleanup = () => emitter.removeAllListeners();
|
|
3017
3017
|
const events = {
|
|
3018
3018
|
message: "message",
|
|
3019
3019
|
response: "response"
|
|
3020
3020
|
};
|
|
3021
|
-
const channel = {
|
|
3022
|
-
onMessage: (callback) => emitter.on(events.message, callback),
|
|
3023
|
-
postMessage: (message) => emitter.emit(events.response, message)
|
|
3024
|
-
};
|
|
3025
3021
|
const rpc = createBirpc(createMethodsRPC(project, {
|
|
3026
3022
|
cacheFs: true,
|
|
3027
3023
|
collect
|
|
@@ -3045,15 +3041,18 @@ function createChildProcessChannel(project, collect) {
|
|
|
3045
3041
|
on(fn) {
|
|
3046
3042
|
emitter.on(events.response, fn);
|
|
3047
3043
|
},
|
|
3048
|
-
|
|
3049
|
-
throw new Error(`[vitest-pool]: Timeout calling "${functionName}"`);
|
|
3050
|
-
}
|
|
3044
|
+
timeout: -1
|
|
3051
3045
|
});
|
|
3052
3046
|
project.vitest.onCancel((reason) => rpc.onCancel(reason));
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3047
|
+
const channel = {
|
|
3048
|
+
onMessage: (callback) => emitter.on(events.message, callback),
|
|
3049
|
+
postMessage: (message) => emitter.emit(events.response, message),
|
|
3050
|
+
onClose: () => {
|
|
3051
|
+
emitter.removeAllListeners();
|
|
3052
|
+
rpc.$close(/* @__PURE__ */ new Error("[vitest-pool]: Pending methods while closing rpc"));
|
|
3053
|
+
}
|
|
3056
3054
|
};
|
|
3055
|
+
return { channel };
|
|
3057
3056
|
}
|
|
3058
3057
|
function createVmForksPool(vitest, { execArgv, env }) {
|
|
3059
3058
|
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length;
|
|
@@ -3090,7 +3089,7 @@ function createVmForksPool(vitest, { execArgv, env }) {
|
|
|
3090
3089
|
async function runFiles(project, config, files, environment, invalidates = []) {
|
|
3091
3090
|
const paths = files.map((f) => f.filepath);
|
|
3092
3091
|
vitest.state.clearFiles(project, paths);
|
|
3093
|
-
const { channel
|
|
3092
|
+
const { channel } = createChildProcessChannel(project, name === "collect");
|
|
3094
3093
|
const workerId = ++id;
|
|
3095
3094
|
const data = {
|
|
3096
3095
|
pool: "forks",
|
|
@@ -3114,7 +3113,7 @@ function createVmForksPool(vitest, { execArgv, env }) {
|
|
|
3114
3113
|
else if (vitest.isCancelling && error instanceof Error && /The task has been cancelled/.test(error.message)) vitest.state.cancelFiles(paths, project);
|
|
3115
3114
|
else throw error;
|
|
3116
3115
|
} finally {
|
|
3117
|
-
|
|
3116
|
+
channel.onClose();
|
|
3118
3117
|
}
|
|
3119
3118
|
}
|
|
3120
3119
|
return async (specs, invalidates) => {
|
|
@@ -3165,14 +3164,17 @@ function createWorkerChannel(project, collect) {
|
|
|
3165
3164
|
on(fn) {
|
|
3166
3165
|
port.on("message", fn);
|
|
3167
3166
|
},
|
|
3168
|
-
|
|
3169
|
-
throw new Error(`[vitest-pool]: Timeout calling "${functionName}"`);
|
|
3170
|
-
}
|
|
3167
|
+
timeout: -1
|
|
3171
3168
|
});
|
|
3172
3169
|
project.vitest.onCancel((reason) => rpc.onCancel(reason));
|
|
3170
|
+
function onClose() {
|
|
3171
|
+
workerPort.close();
|
|
3172
|
+
port.close();
|
|
3173
|
+
rpc.$close(/* @__PURE__ */ new Error("[vitest-pool]: Pending methods while closing rpc"));
|
|
3174
|
+
}
|
|
3173
3175
|
return {
|
|
3174
3176
|
workerPort,
|
|
3175
|
-
|
|
3177
|
+
onClose
|
|
3176
3178
|
};
|
|
3177
3179
|
}
|
|
3178
3180
|
function createVmThreadsPool(vitest, { execArgv, env }) {
|
|
@@ -3210,7 +3212,7 @@ function createVmThreadsPool(vitest, { execArgv, env }) {
|
|
|
3210
3212
|
async function runFiles(project, config, files, environment, invalidates = []) {
|
|
3211
3213
|
const paths = files.map((f) => f.filepath);
|
|
3212
3214
|
vitest.state.clearFiles(project, paths);
|
|
3213
|
-
const { workerPort,
|
|
3215
|
+
const { workerPort, onClose } = createWorkerChannel(project, name === "collect");
|
|
3214
3216
|
const workerId = ++id;
|
|
3215
3217
|
const data = {
|
|
3216
3218
|
pool: "vmThreads",
|
|
@@ -3235,8 +3237,7 @@ function createVmThreadsPool(vitest, { execArgv, env }) {
|
|
|
3235
3237
|
else if (vitest.isCancelling && error instanceof Error && /The task has been cancelled/.test(error.message)) vitest.state.cancelFiles(paths, project);
|
|
3236
3238
|
else throw error;
|
|
3237
3239
|
} finally {
|
|
3238
|
-
|
|
3239
|
-
workerPort.close();
|
|
3240
|
+
onClose();
|
|
3240
3241
|
}
|
|
3241
3242
|
}
|
|
3242
3243
|
return async (specs, invalidates) => {
|
|
@@ -3544,6 +3545,7 @@ function resolveConfig$1(vitest, options, viteConfig) {
|
|
|
3544
3545
|
resolved.provide ??= {};
|
|
3545
3546
|
resolved.name = typeof options.name === "string" ? options.name : options.name?.label || "";
|
|
3546
3547
|
resolved.color = typeof options.name !== "string" ? options.name?.color : void 0;
|
|
3548
|
+
if (resolved.environment === "browser") throw new Error(`Looks like you set "test.environment" to "browser". To enabled Browser Mode, use "test.browser.enabled" instead.`);
|
|
3547
3549
|
const inspector = resolved.inspect || resolved.inspectBrk;
|
|
3548
3550
|
resolved.inspector = {
|
|
3549
3551
|
...resolved.inspector,
|
|
@@ -196,6 +196,41 @@ test('renders name', async () => {
|
|
|
196
196
|
})
|
|
197
197
|
`
|
|
198
198
|
};
|
|
199
|
+
const qwikExample = {
|
|
200
|
+
name: "HelloWorld.jsx",
|
|
201
|
+
js: `
|
|
202
|
+
import { component$ } from '@builder.io/qwik'
|
|
203
|
+
|
|
204
|
+
export default component$(({ name }) => {
|
|
205
|
+
return (
|
|
206
|
+
<div>
|
|
207
|
+
<h1>Hello {name}!</h1>
|
|
208
|
+
</div>
|
|
209
|
+
)
|
|
210
|
+
})
|
|
211
|
+
`,
|
|
212
|
+
ts: `
|
|
213
|
+
import { component$ } from '@builder.io/qwik'
|
|
214
|
+
|
|
215
|
+
export default component$(({ name }: { name: string }) => {
|
|
216
|
+
return (
|
|
217
|
+
<div>
|
|
218
|
+
<h1>Hello {name}!</h1>
|
|
219
|
+
</div>
|
|
220
|
+
)
|
|
221
|
+
})
|
|
222
|
+
`,
|
|
223
|
+
test: `
|
|
224
|
+
import { expect, test } from 'vitest'
|
|
225
|
+
import { render } from 'vitest-browser-qwik'
|
|
226
|
+
import HelloWorld from './HelloWorld.tsx'
|
|
227
|
+
|
|
228
|
+
test('renders name', async () => {
|
|
229
|
+
const { getByText } = render(<HelloWorld name="Vitest" />)
|
|
230
|
+
await expect.element(getByText('Hello Vitest!')).toBeInTheDocument()
|
|
231
|
+
})
|
|
232
|
+
`
|
|
233
|
+
};
|
|
199
234
|
const vanillaExample = {
|
|
200
235
|
name: "HelloWorld.js",
|
|
201
236
|
js: `
|
|
@@ -249,6 +284,7 @@ function getExampleTest(framework) {
|
|
|
249
284
|
case "svelte": return svelteExample;
|
|
250
285
|
case "lit": return litExample;
|
|
251
286
|
case "marko": return markoExample;
|
|
287
|
+
case "qwik": return qwikExample;
|
|
252
288
|
default: return vanillaExample;
|
|
253
289
|
}
|
|
254
290
|
}
|
|
@@ -362,6 +398,11 @@ function getFramework() {
|
|
|
362
398
|
title: "marko",
|
|
363
399
|
value: "marko",
|
|
364
400
|
description: "\"A declarative, HTML-based language that makes building web apps fun\""
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
title: "qwik",
|
|
404
|
+
value: "qwik",
|
|
405
|
+
description: "\"Instantly interactive web apps at scale\""
|
|
365
406
|
}
|
|
366
407
|
];
|
|
367
408
|
}
|
|
@@ -375,6 +416,7 @@ function getFrameworkTestPackage(framework) {
|
|
|
375
416
|
case "preact": return "vitest-browser-preact";
|
|
376
417
|
case "solid": return "@solidjs/testing-library";
|
|
377
418
|
case "marko": return "@marko/testing-library";
|
|
419
|
+
case "qwik": return "vitest-browser-qwik";
|
|
378
420
|
}
|
|
379
421
|
throw new Error(`Unsupported framework: ${framework}`);
|
|
380
422
|
}
|
|
@@ -386,6 +428,7 @@ function getFrameworkPluginPackage(framework) {
|
|
|
386
428
|
case "preact": return "@preact/preset-vite";
|
|
387
429
|
case "solid": return "vite-plugin-solid";
|
|
388
430
|
case "marko": return "@marko/vite";
|
|
431
|
+
case "qwik": return "@builder.io/qwik/optimizer";
|
|
389
432
|
}
|
|
390
433
|
return null;
|
|
391
434
|
}
|
|
@@ -441,6 +484,7 @@ function getPossibleFramework(dependencies) {
|
|
|
441
484
|
if (dependencies.preact) return "preact";
|
|
442
485
|
if (dependencies["solid-js"] || dependencies["@solidjs/start"]) return "solid";
|
|
443
486
|
if (dependencies.marko) return "marko";
|
|
487
|
+
if (dependencies["@builder.io/qwik"] || dependencies["@qwik.dev/core"]) return "qwik";
|
|
444
488
|
return "vanilla";
|
|
445
489
|
}
|
|
446
490
|
function getPossibleProvider(dependencies) {
|
|
@@ -463,14 +507,31 @@ function sort(choices, value) {
|
|
|
463
507
|
function fail() {
|
|
464
508
|
process.exitCode = 1;
|
|
465
509
|
}
|
|
510
|
+
function getFrameworkImportInfo(framework) {
|
|
511
|
+
switch (framework) {
|
|
512
|
+
case "svelte": return {
|
|
513
|
+
importName: "svelte",
|
|
514
|
+
isNamedExport: true
|
|
515
|
+
};
|
|
516
|
+
case "qwik": return {
|
|
517
|
+
importName: "qwikVite",
|
|
518
|
+
isNamedExport: true
|
|
519
|
+
};
|
|
520
|
+
default: return {
|
|
521
|
+
importName: framework,
|
|
522
|
+
isNamedExport: false
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
}
|
|
466
526
|
async function generateFrameworkConfigFile(options) {
|
|
467
|
-
const
|
|
527
|
+
const { importName, isNamedExport } = getFrameworkImportInfo(options.framework);
|
|
528
|
+
const frameworkImport = isNamedExport ? `import { ${importName} } from '${options.frameworkPlugin}'` : `import ${importName} from '${options.frameworkPlugin}'`;
|
|
468
529
|
const configContent = [
|
|
469
530
|
`import { defineConfig } from 'vitest/config'`,
|
|
470
531
|
options.frameworkPlugin ? frameworkImport : null,
|
|
471
532
|
``,
|
|
472
533
|
"export default defineConfig({",
|
|
473
|
-
options.frameworkPlugin ? ` plugins: [${
|
|
534
|
+
options.frameworkPlugin ? ` plugins: [${importName}()],` : null,
|
|
474
535
|
` test: {`,
|
|
475
536
|
` browser: {`,
|
|
476
537
|
` enabled: true,`,
|
|
@@ -29,10 +29,13 @@ function createBirpc(functions, options) {
|
|
|
29
29
|
return functions;
|
|
30
30
|
if (method === "$close")
|
|
31
31
|
return close;
|
|
32
|
+
if (method === "$rejectPendingCalls") {
|
|
33
|
+
return rejectPendingCalls;
|
|
34
|
+
}
|
|
32
35
|
if (method === "$closed")
|
|
33
36
|
return closed;
|
|
34
37
|
if (method === "then" && !eventNames.includes("then") && !("then" in functions))
|
|
35
|
-
return
|
|
38
|
+
return void 0;
|
|
36
39
|
const sendEvent = (...args) => {
|
|
37
40
|
post(serialize({ m: method, a: args, t: TYPE_REQUEST }));
|
|
38
41
|
};
|
|
@@ -47,7 +50,7 @@ function createBirpc(functions, options) {
|
|
|
47
50
|
try {
|
|
48
51
|
await _promise;
|
|
49
52
|
} finally {
|
|
50
|
-
_promise =
|
|
53
|
+
_promise = void 0;
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
return new Promise((resolve, reject) => {
|
|
@@ -75,14 +78,30 @@ function createBirpc(functions, options) {
|
|
|
75
78
|
return sendCall;
|
|
76
79
|
}
|
|
77
80
|
});
|
|
78
|
-
function close(
|
|
81
|
+
function close(customError) {
|
|
79
82
|
closed = true;
|
|
80
83
|
rpcPromiseMap.forEach(({ reject, method }) => {
|
|
81
|
-
|
|
84
|
+
const error = new Error(`[birpc] rpc is closed, cannot call "${method}"`);
|
|
85
|
+
if (customError) {
|
|
86
|
+
customError.cause ??= error;
|
|
87
|
+
return reject(customError);
|
|
88
|
+
}
|
|
89
|
+
reject(error);
|
|
82
90
|
});
|
|
83
91
|
rpcPromiseMap.clear();
|
|
84
92
|
off(onMessage);
|
|
85
93
|
}
|
|
94
|
+
function rejectPendingCalls(handler) {
|
|
95
|
+
const entries = Array.from(rpcPromiseMap.values());
|
|
96
|
+
const handlerResults = entries.map(({ method, reject }) => {
|
|
97
|
+
if (!handler) {
|
|
98
|
+
return reject(new Error(`[birpc]: rejected pending call "${method}".`));
|
|
99
|
+
}
|
|
100
|
+
return handler({ method, reject });
|
|
101
|
+
});
|
|
102
|
+
rpcPromiseMap.clear();
|
|
103
|
+
return handlerResults;
|
|
104
|
+
}
|
|
86
105
|
async function onMessage(data, ...extra) {
|
|
87
106
|
let msg;
|
|
88
107
|
try {
|
|
@@ -2,7 +2,7 @@ import * as chai from 'chai';
|
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { l as loadDiffConfig, b as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.Ebx5x0eP.js';
|
|
4
4
|
import { distDir } from '../path.js';
|
|
5
|
-
import { r as rpc } from './rpc.
|
|
5
|
+
import { r as rpc } from './rpc.jnQO9F8a.js';
|
|
6
6
|
import { g as getWorkerState } from './utils.XdZDrNZV.js';
|
|
7
7
|
|
|
8
8
|
function setupChaiConfig(config) {
|
|
@@ -4,7 +4,7 @@ import { ParsedStack, Awaitable, TestError, SerializedError, Arrayable } from '@
|
|
|
4
4
|
import { Writable } from 'node:stream';
|
|
5
5
|
import { ViteDevServer, ModuleNode, TransformResult as TransformResult$1, DepOptimizationConfig, ServerOptions, UserConfig as UserConfig$1, ConfigEnv, AliasOptions } from 'vite';
|
|
6
6
|
import { Console } from 'node:console';
|
|
7
|
-
import { B as BrowserTesterOptions, S as SerializedTestSpecification } from './browser.d.
|
|
7
|
+
import { B as BrowserTesterOptions, S as SerializedTestSpecification } from './browser.d.BRP8scJf.js';
|
|
8
8
|
import { MockedModule } from '@vitest/mocker';
|
|
9
9
|
import { StackTraceParserOptions } from '@vitest/utils/source-map';
|
|
10
10
|
import { a as SerializedConfig, F as FakeTimerInstallOpts } from './config.d.DZo8c7fw.js';
|
|
@@ -286,6 +286,17 @@ interface BrowserConfigOptions {
|
|
|
286
286
|
* @default 30000
|
|
287
287
|
*/
|
|
288
288
|
connectTimeout?: number;
|
|
289
|
+
expect?: {
|
|
290
|
+
toMatchScreenshot?: { [ComparatorName in keyof ToMatchScreenshotComparators] : {
|
|
291
|
+
/**
|
|
292
|
+
* The name of the comparator to use for visual diffing.
|
|
293
|
+
*
|
|
294
|
+
* @defaultValue `'pixelmatch'`
|
|
295
|
+
*/
|
|
296
|
+
comparatorName?: ComparatorName;
|
|
297
|
+
comparatorOptions?: ToMatchScreenshotComparators[ComparatorName];
|
|
298
|
+
} }[keyof ToMatchScreenshotComparators] & ToMatchScreenshotOptions;
|
|
299
|
+
};
|
|
289
300
|
}
|
|
290
301
|
interface BrowserCommandContext {
|
|
291
302
|
testPath: string | undefined;
|
|
@@ -368,6 +379,90 @@ interface ResolvedBrowserOptions extends BrowserConfigOptions {
|
|
|
368
379
|
testIdAttribute: string;
|
|
369
380
|
};
|
|
370
381
|
}
|
|
382
|
+
type ToMatchScreenshotResolvePath = (data: {
|
|
383
|
+
/**
|
|
384
|
+
* Path **without** extension, sanitized and relative to the test file.
|
|
385
|
+
*
|
|
386
|
+
* This comes from the arguments passed to `toMatchScreenshot`; if called
|
|
387
|
+
* without arguments this will be the auto-generated name.
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* test('calls `onClick`', () => {
|
|
391
|
+
* expect(locator).toMatchScreenshot()
|
|
392
|
+
* // arg = "calls-onclick-1"
|
|
393
|
+
* })
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* expect(locator).toMatchScreenshot('foo/bar/baz.png')
|
|
397
|
+
* // arg = "foo/bar/baz"
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* expect(locator).toMatchScreenshot('../foo/bar/baz.png')
|
|
401
|
+
* // arg = "foo/bar/baz"
|
|
402
|
+
*/
|
|
403
|
+
arg: string;
|
|
404
|
+
/**
|
|
405
|
+
* Screenshot extension, with leading dot.
|
|
406
|
+
*
|
|
407
|
+
* This can be set through the arguments passed to `toMatchScreenshot`, but
|
|
408
|
+
* the value will fall back to `'.png'` if an unsupported extension is used.
|
|
409
|
+
*/
|
|
410
|
+
ext: string;
|
|
411
|
+
/**
|
|
412
|
+
* The instance's browser name.
|
|
413
|
+
*/
|
|
414
|
+
browserName: string;
|
|
415
|
+
/**
|
|
416
|
+
* The value of {@linkcode process.platform}.
|
|
417
|
+
*/
|
|
418
|
+
platform: NodeJS.Platform;
|
|
419
|
+
/**
|
|
420
|
+
* The value provided to
|
|
421
|
+
* {@linkcode https://vitest.dev/guide/browser/config#browser-screenshotdirectory|browser.screenshotDirectory},
|
|
422
|
+
* if none is provided, its default value.
|
|
423
|
+
*/
|
|
424
|
+
screenshotDirectory: string;
|
|
425
|
+
/**
|
|
426
|
+
* Absolute path to the project's
|
|
427
|
+
* {@linkcode https://vitest.dev/config/#root|root}.
|
|
428
|
+
*/
|
|
429
|
+
root: string;
|
|
430
|
+
/**
|
|
431
|
+
* Path to the test file, relative to the project's
|
|
432
|
+
* {@linkcode https://vitest.dev/config/#root|root}.
|
|
433
|
+
*/
|
|
434
|
+
testFileDirectory: string;
|
|
435
|
+
/**
|
|
436
|
+
* The test's filename.
|
|
437
|
+
*/
|
|
438
|
+
testFileName: string;
|
|
439
|
+
/**
|
|
440
|
+
* The {@linkcode https://vitest.dev/api/#test|test}'s name, including
|
|
441
|
+
* parent {@linkcode https://vitest.dev/api/#describe|describe}, sanitized.
|
|
442
|
+
*/
|
|
443
|
+
testName: string;
|
|
444
|
+
/**
|
|
445
|
+
* The value provided to
|
|
446
|
+
* {@linkcode https://vitest.dev/config/#attachmentsdir|attachmentsDir},
|
|
447
|
+
* if none is provided, its default value.
|
|
448
|
+
*/
|
|
449
|
+
attachmentsDir: string;
|
|
450
|
+
}) => string;
|
|
451
|
+
interface ToMatchScreenshotOptions {
|
|
452
|
+
/**
|
|
453
|
+
* Overrides default reference screenshot path.
|
|
454
|
+
*
|
|
455
|
+
* @default `${root}/${testFileDirectory}/${screenshotDirectory}/${testFileName}/${arg}-${browserName}-${platform}${ext}`
|
|
456
|
+
*/
|
|
457
|
+
resolveScreenshotPath?: ToMatchScreenshotResolvePath;
|
|
458
|
+
/**
|
|
459
|
+
* Overrides default screenshot path used for diffs.
|
|
460
|
+
*
|
|
461
|
+
* @default `${root}/${attachmentsDir}/${testFileDirectory}/${testFileName}/${arg}-${browserName}-${platform}${ext}`
|
|
462
|
+
*/
|
|
463
|
+
resolveDiffPath?: ToMatchScreenshotResolvePath;
|
|
464
|
+
}
|
|
465
|
+
interface ToMatchScreenshotComparators {}
|
|
371
466
|
|
|
372
467
|
declare class ReportedTaskImplementation {
|
|
373
468
|
/**
|
|
@@ -3126,5 +3221,5 @@ type TestProjectInlineConfiguration = (UserWorkspaceConfig & {
|
|
|
3126
3221
|
});
|
|
3127
3222
|
type TestProjectConfiguration = string | TestProjectInlineConfiguration | Promise<UserWorkspaceConfig> | UserProjectConfigFn;
|
|
3128
3223
|
|
|
3129
|
-
export { CoverageMap as C, TestSuite as E, Logger as L, TestProject as T, Vitest as V, BenchmarkReportsMap as
|
|
3130
|
-
export type { BrowserOrchestrator as $, ApiConfig as A, TestResultSkipped as B, TestState as D, TestSuiteState as F, TestSequencerConstructor as G, HTMLOptions as H, InlineConfig as I, JsonOptions$1 as J, BenchmarkUserOptions as K, ModuleDiagnostic as M, BrowserBuiltinProvider as N, OnServerRestartHandler as O, ProcessPool as P, BrowserCommand as Q, ResolvedCoverageOptions as R, SerializedTestProject as S, UserWorkspaceConfig as U, WatcherTriggerPattern as W, BrowserCommandContext as X, BrowserConfigOptions as Y, BrowserInstanceOption as Z, BrowserModuleMocker as _, TestProjectConfiguration as a, BrowserProvider as a0, BrowserProviderInitializationOptions as a1, BrowserProviderModule as a2, BrowserProviderOptions as a3, BrowserScript as a4, BrowserServerState as a5, BrowserServerStateSession as a6, CDPSession as a7, ParentProjectBrowser as a8, ProjectBrowser as a9, BenchmarkBuiltinReporters as
|
|
3224
|
+
export { CoverageMap as C, TestSuite as E, Logger as L, TestProject as T, Vitest as V, BenchmarkReporter as aB, BenchmarkReportsMap as aC, DefaultReporter as aD, DotReporter as aE, GithubActionsReporter as aF, HangingProcessReporter as aG, JsonReporter as aH, JUnitReporter as aI, ReportersMap as aJ, TapFlatReporter as aK, TapReporter as aL, VerboseBenchmarkReporter as aM, VerboseReporter as aN, BaseReporter as aO, TestSpecification as l, VitestPackageInstaller as n, getFilePoolName as p, TestCase as s, TestCollection as t, TestModule as v };
|
|
3225
|
+
export type { BrowserOrchestrator as $, ApiConfig as A, TestResultSkipped as B, TestState as D, TestSuiteState as F, TestSequencerConstructor as G, HTMLOptions as H, InlineConfig as I, JsonOptions$1 as J, BenchmarkUserOptions as K, ModuleDiagnostic as M, BrowserBuiltinProvider as N, OnServerRestartHandler as O, ProcessPool as P, BrowserCommand as Q, ResolvedCoverageOptions as R, SerializedTestProject as S, UserWorkspaceConfig as U, WatcherTriggerPattern as W, BrowserCommandContext as X, BrowserConfigOptions as Y, BrowserInstanceOption as Z, BrowserModuleMocker as _, TestProjectConfiguration as a, BrowserProvider as a0, BrowserProviderInitializationOptions as a1, BrowserProviderModule as a2, BrowserProviderOptions as a3, BrowserScript as a4, BrowserServerState as a5, BrowserServerStateSession as a6, CDPSession as a7, ParentProjectBrowser as a8, ProjectBrowser as a9, TestRunEndReason as aA, BenchmarkBuiltinReporters as aP, BuiltinReporterOptions as aQ, BuiltinReporters as aR, JsonAssertionResult as aS, JsonTestResult as aT, JsonTestResults as aU, ResolvedBrowserOptions as aa, ToMatchScreenshotComparators as ab, ToMatchScreenshotOptions as ac, BuiltinEnvironment as ad, CSSModuleScopeStrategy as ae, DepsOptimizationOptions as af, EnvironmentOptions as ag, Pool as ah, PoolOptions as ai, ProjectConfig as aj, ResolvedProjectConfig as ak, ResolveSnapshotPathHandler as al, ResolveSnapshotPathHandlerContext as am, TransformModePatterns as an, TypecheckConfig as ao, VitestEnvironment as ap, BaseCoverageOptions as aq, CoverageIstanbulOptions as ar, CoverageOptions as as, CoverageProvider as at, CoverageProviderModule as au, CoverageReporter as av, CustomProviderOptions as aw, TestRunResult as ax, ReportedHookContext as ay, Reporter as az, ReportContext as b, CoverageV8Options as c, UserProjectConfigFn as d, UserProjectConfigExport as e, UserConfig as f, TestProjectInlineConfiguration as g, ResolvedConfig as h, VitestRunMode as i, VitestOptions as j, TestSequencer as k, OnTestsRerunHandler as m, WorkspaceSpec as o, JUnitOptions as q, TaskOptions as r, TestDiagnostic as u, TestModuleState as w, TestResult as x, TestResultFailed as y, TestResultPassed as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSafeTimers } from '@vitest/utils';
|
|
2
|
-
import { c as createBirpc } from './index.
|
|
2
|
+
import { c as createBirpc } from './index.Bgo3tNWt.js';
|
|
3
3
|
import { g as getWorkerState } from './utils.XdZDrNZV.js';
|
|
4
4
|
|
|
5
5
|
const { get } = Reflect;
|
|
@@ -45,13 +45,7 @@ function createRuntimeRpc(options) {
|
|
|
45
45
|
"onCollected",
|
|
46
46
|
"onCancel"
|
|
47
47
|
],
|
|
48
|
-
|
|
49
|
-
let message = `[vitest-worker]: Timeout calling "${functionName}"`;
|
|
50
|
-
if (functionName === "fetch" || functionName === "transform" || functionName === "resolveId") message += ` with "${JSON.stringify(args)}"`;
|
|
51
|
-
// JSON.stringify cannot serialize Error instances
|
|
52
|
-
if (functionName === "onUnhandledError") message += ` with "${args[0]?.message || args[0]}"`;
|
|
53
|
-
throw new Error(message);
|
|
54
|
-
},
|
|
48
|
+
timeout: -1,
|
|
55
49
|
...options
|
|
56
50
|
}));
|
|
57
51
|
return {
|
|
@@ -61,6 +55,8 @@ function createRuntimeRpc(options) {
|
|
|
61
55
|
}
|
|
62
56
|
function createSafeRpc(rpc) {
|
|
63
57
|
return new Proxy(rpc, { get(target, p, handler) {
|
|
58
|
+
// keep $rejectPendingCalls as sync function
|
|
59
|
+
if (p === "$rejectPendingCalls") return rpc.$rejectPendingCalls;
|
|
64
60
|
const sendCall = get(target, p, handler);
|
|
65
61
|
const safeSendCall = (...args) => withSafeTimers(async () => {
|
|
66
62
|
const result = sendCall(...args);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { performance } from 'node:perf_hooks';
|
|
2
2
|
import { startTests, collectTests } from '@vitest/runner';
|
|
3
|
-
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.
|
|
3
|
+
import { a as resolveSnapshotEnvironment, s as setupChaiConfig, r as resolveTestRunner } from './index.CtUvr1c8.js';
|
|
4
4
|
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from './setup-common.Ebx5x0eP.js';
|
|
5
5
|
import { a as globalExpect, v as vi } from './vi.CA0EPI9Y.js';
|
|
6
6
|
import { c as closeInspector } from './inspector.C914Efll.js';
|
|
@@ -17,8 +17,8 @@ import 'chai';
|
|
|
17
17
|
import 'node:path';
|
|
18
18
|
import '../path.js';
|
|
19
19
|
import 'node:url';
|
|
20
|
-
import './rpc.
|
|
21
|
-
import './index.
|
|
20
|
+
import './rpc.jnQO9F8a.js';
|
|
21
|
+
import './index.Bgo3tNWt.js';
|
|
22
22
|
import './coverage.DVF1vEu8.js';
|
|
23
23
|
import '@vitest/snapshot';
|
|
24
24
|
import '@vitest/expect';
|
|
@@ -92,7 +92,16 @@ type BirpcReturn<RemoteFunctions, LocalFunctions = Record<string, never>> = {
|
|
|
92
92
|
$functions: LocalFunctions;
|
|
93
93
|
$close: (error?: Error) => void;
|
|
94
94
|
$closed: boolean;
|
|
95
|
+
$rejectPendingCalls: (handler?: PendingCallHandler) => Promise<void>[];
|
|
95
96
|
};
|
|
97
|
+
type PendingCallHandler = (options: Pick<PromiseEntry, 'method' | 'reject'>) => void | Promise<void>;
|
|
98
|
+
interface PromiseEntry {
|
|
99
|
+
resolve: (arg: any) => void;
|
|
100
|
+
reject: (error: any) => void;
|
|
101
|
+
method: string;
|
|
102
|
+
timeoutId?: ReturnType<typeof setTimeout>;
|
|
103
|
+
}
|
|
104
|
+
declare const setTimeout: typeof globalThis.setTimeout;
|
|
96
105
|
|
|
97
106
|
interface RuntimeRPC {
|
|
98
107
|
fetch: (id: string, transformMode: TransformMode) => Promise<{
|
package/dist/cli.js
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { HookHandler, ConfigEnv, UserConfig } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { I as InlineConfig, c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport } from './chunks/reporters.d.
|
|
4
|
-
export { a as TestProjectConfiguration, g as TestProjectInlineConfiguration, f as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.
|
|
5
|
-
import { V as VitestPluginContext } from './chunks/plugin.d.
|
|
3
|
+
import { I as InlineConfig, c as CoverageV8Options, R as ResolvedCoverageOptions, U as UserWorkspaceConfig, d as UserProjectConfigFn, e as UserProjectConfigExport } from './chunks/reporters.d.DWg40D2B.js';
|
|
4
|
+
export { a as TestProjectConfiguration, g as TestProjectInlineConfiguration, f as TestUserConfig, W as WatcherTriggerPattern } from './chunks/reporters.d.DWg40D2B.js';
|
|
5
|
+
import { V as VitestPluginContext } from './chunks/plugin.d.CLhMcYdD.js';
|
|
6
6
|
import { F as FakeTimerInstallOpts } from './chunks/config.d.DZo8c7fw.js';
|
|
7
7
|
import '@vitest/runner';
|
|
8
8
|
import './chunks/environment.d.Bhm9oc0v.js';
|
|
9
9
|
import '@vitest/utils';
|
|
10
10
|
import 'node:stream';
|
|
11
11
|
import 'node:console';
|
|
12
|
-
import './chunks/browser.d.
|
|
13
|
-
import './chunks/worker.d.
|
|
12
|
+
import './chunks/browser.d.BRP8scJf.js';
|
|
13
|
+
import './chunks/worker.d.zjyR34Pb.js';
|
|
14
14
|
import '@vitest/snapshot';
|
|
15
15
|
import '@vitest/mocker';
|
|
16
16
|
import '@vitest/utils/source-map';
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, b as ReportContext } from './chunks/reporters.d.
|
|
1
|
+
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, b as ReportContext } from './chunks/reporters.d.DWg40D2B.js';
|
|
2
2
|
import { TransformResult } from 'vite';
|
|
3
3
|
import { A as AfterSuiteRunMeta } from './chunks/environment.d.Bhm9oc0v.js';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import '@vitest/utils';
|
|
6
6
|
import 'node:stream';
|
|
7
7
|
import 'node:console';
|
|
8
|
-
import './chunks/browser.d.
|
|
9
|
-
import './chunks/worker.d.
|
|
8
|
+
import './chunks/browser.d.BRP8scJf.js';
|
|
9
|
+
import './chunks/worker.d.zjyR34Pb.js';
|
|
10
10
|
import './chunks/config.d.DZo8c7fw.js';
|
|
11
11
|
import '@vitest/pretty-format';
|
|
12
12
|
import '@vitest/snapshot';
|
package/dist/coverage.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BaseCoverageProvider } from './chunks/coverage.
|
|
1
|
+
export { B as BaseCoverageProvider } from './chunks/coverage.C84l9G-M.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'node:path';
|
|
4
4
|
import 'pathe';
|
|
@@ -23,7 +23,7 @@ import 'vite';
|
|
|
23
23
|
import './chunks/constants.CXzqaLmq.js';
|
|
24
24
|
import 'node:tty';
|
|
25
25
|
import 'node:events';
|
|
26
|
-
import './chunks/index.
|
|
26
|
+
import './chunks/index.Bgo3tNWt.js';
|
|
27
27
|
import 'tinypool';
|
|
28
28
|
import './chunks/typechecker.CMNPqJOo.js';
|
|
29
29
|
import 'node:perf_hooks';
|
package/dist/execute.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ViteNodeRunnerOptions } from 'vite-node';
|
|
2
2
|
import { ViteNodeRunner, ModuleExecutionInfo } from 'vite-node/client';
|
|
3
|
-
import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.d.
|
|
3
|
+
import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.d.zjyR34Pb.js';
|
|
4
4
|
import vm from 'node:vm';
|
|
5
5
|
import { MockedModule, MockedModuleType } from '@vitest/mocker';
|
|
6
6
|
import { P as PendingSuiteMock, b as MockFactory, a as MockOptions } from './chunks/mocker.d.BE_2ls6u.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { S as SerializedTestSpecification } from './chunks/browser.d.
|
|
2
|
-
export { B as BrowserTesterOptions } from './chunks/browser.d.
|
|
1
|
+
import { S as SerializedTestSpecification } from './chunks/browser.d.BRP8scJf.js';
|
|
2
|
+
export { B as BrowserTesterOptions } from './chunks/browser.d.BRP8scJf.js';
|
|
3
3
|
import './chunks/global.d.DAhT2emn.js';
|
|
4
4
|
import { File, TestAnnotation, TaskResultPack, TaskEventPack, TaskPopulated } from '@vitest/runner';
|
|
5
5
|
export { CancelReason, HookCleanupCallback, HookListener, ImportDuration, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskEventPack as RunnerTaskEventPack, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestContext, TestFunction, TestOptions, afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
6
|
-
import { a as BirpcReturn } from './chunks/worker.d.
|
|
7
|
-
export { C as ContextRPC, c as ContextTestEnvironment, b as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.
|
|
6
|
+
import { a as BirpcReturn } from './chunks/worker.d.zjyR34Pb.js';
|
|
7
|
+
export { C as ContextRPC, c as ContextTestEnvironment, b as RunnerRPC, R as RuntimeRPC, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.zjyR34Pb.js';
|
|
8
8
|
import { a as SerializedConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.DZo8c7fw.js';
|
|
9
9
|
export { b as RuntimeConfig, S as SerializedCoverageConfig } from './chunks/config.d.DZo8c7fw.js';
|
|
10
10
|
import { b as Awaitable, U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext } from './chunks/environment.d.Bhm9oc0v.js';
|
package/dist/node.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ import { InlineConfig, UserConfig as UserConfig$1, Plugin, ResolvedConfig as Res
|
|
|
3
3
|
export { vite as Vite };
|
|
4
4
|
export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
5
5
|
import { IncomingMessage } from 'node:http';
|
|
6
|
-
import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, T as TestProject, k as TestSequencer, l as TestSpecification, L as Logger } from './chunks/reporters.d.
|
|
7
|
-
export {
|
|
8
|
-
import { R as RuntimeRPC } from './chunks/worker.d.
|
|
9
|
-
export { T as TestExecutionType } from './chunks/worker.d.
|
|
6
|
+
import { h as ResolvedConfig, f as UserConfig, i as VitestRunMode, j as VitestOptions, V as Vitest, A as ApiConfig, T as TestProject, k as TestSequencer, l as TestSpecification, L as Logger } from './chunks/reporters.d.DWg40D2B.js';
|
|
7
|
+
export { aq as BaseCoverageOptions, K as BenchmarkUserOptions, N as BrowserBuiltinProvider, Q as BrowserCommand, X as BrowserCommandContext, Y as BrowserConfigOptions, Z as BrowserInstanceOption, _ as BrowserModuleMocker, $ as BrowserOrchestrator, a0 as BrowserProvider, a1 as BrowserProviderInitializationOptions, a2 as BrowserProviderModule, a3 as BrowserProviderOptions, a4 as BrowserScript, a5 as BrowserServerState, a6 as BrowserServerStateSession, ad as BuiltinEnvironment, a7 as CDPSession, ae as CSSModuleScopeStrategy, ar as CoverageIstanbulOptions, as as CoverageOptions, at as CoverageProvider, au as CoverageProviderModule, av as CoverageReporter, c as CoverageV8Options, aw as CustomProviderOptions, af as DepsOptimizationOptions, ag as EnvironmentOptions, H as HTMLOptions, I as InlineConfig, q as JUnitOptions, J as JsonOptions, M as ModuleDiagnostic, O as OnServerRestartHandler, m as OnTestsRerunHandler, a8 as ParentProjectBrowser, ah as Pool, ai as PoolOptions, P as ProcessPool, a9 as ProjectBrowser, aj as ProjectConfig, b as ReportContext, ay as ReportedHookContext, az as Reporter, al as ResolveSnapshotPathHandler, am as ResolveSnapshotPathHandlerContext, aa as ResolvedBrowserOptions, R as ResolvedCoverageOptions, ak as ResolvedProjectConfig, S as SerializedTestProject, r as TaskOptions, s as TestCase, t as TestCollection, u as TestDiagnostic, v as TestModule, w as TestModuleState, x as TestResult, y as TestResultFailed, z as TestResultPassed, B as TestResultSkipped, aA as TestRunEndReason, ax as TestRunResult, G as TestSequencerConstructor, D as TestState, E as TestSuite, F as TestSuiteState, ab as ToMatchScreenshotComparators, ac as ToMatchScreenshotOptions, an as TransformModePatterns, ao as TypecheckConfig, U as UserWorkspaceConfig, ap as VitestEnvironment, n as VitestPackageInstaller, W as WatcherTriggerPattern, o as WorkspaceSpec, p as getFilePoolName } from './chunks/reporters.d.DWg40D2B.js';
|
|
8
|
+
import { R as RuntimeRPC } from './chunks/worker.d.zjyR34Pb.js';
|
|
9
|
+
export { T as TestExecutionType } from './chunks/worker.d.zjyR34Pb.js';
|
|
10
10
|
import { Writable } from 'node:stream';
|
|
11
|
-
export { V as VitestPluginContext } from './chunks/plugin.d.
|
|
12
|
-
export { W as WorkerContext } from './chunks/worker.d.
|
|
11
|
+
export { V as VitestPluginContext } from './chunks/plugin.d.CLhMcYdD.js';
|
|
12
|
+
export { W as WorkerContext } from './chunks/worker.d.C-1AbnVe.js';
|
|
13
13
|
import { Debugger } from 'debug';
|
|
14
14
|
import './chunks/global.d.DAhT2emn.js';
|
|
15
15
|
export { Task as RunnerTask, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SequenceHooks, SequenceSetupFiles } from '@vitest/runner';
|
|
@@ -18,7 +18,7 @@ export { SerializedError } from '@vitest/utils';
|
|
|
18
18
|
export { generateFileHash } from '@vitest/runner/utils';
|
|
19
19
|
import './chunks/environment.d.Bhm9oc0v.js';
|
|
20
20
|
import 'node:console';
|
|
21
|
-
import './chunks/browser.d.
|
|
21
|
+
import './chunks/browser.d.BRP8scJf.js';
|
|
22
22
|
import '@vitest/mocker';
|
|
23
23
|
import '@vitest/utils/source-map';
|
|
24
24
|
import '@vitest/pretty-format';
|
|
@@ -104,7 +104,7 @@ declare function parseCLI(argv: string | string[], config?: CliParseOptions): {
|
|
|
104
104
|
options: CliOptions;
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
declare function resolveApiServerConfig<Options extends ApiConfig & UserConfig
|
|
107
|
+
declare function resolveApiServerConfig<Options extends ApiConfig & Omit<UserConfig, "expect">>(options: Options, defaultPort: number): ApiConfig | undefined;
|
|
108
108
|
|
|
109
109
|
declare function createVitest(mode: VitestRunMode, options: CliOptions, viteOverrides?: UserConfig$1, vitestOptions?: VitestOptions): Promise<Vitest>;
|
|
110
110
|
|
package/dist/node.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
import { resolveConfig as resolveConfig$1, mergeConfig } from 'vite';
|
|
3
3
|
export { esbuildVersion, isCSSRequest, isFileServingAllowed, parseAst, parseAstAsync, rollupVersion, version as viteVersion } from 'vite';
|
|
4
|
-
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.
|
|
5
|
-
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.
|
|
6
|
-
export { p as parseCLI } from './chunks/cac.
|
|
7
|
-
import { r as resolveConfig$2 } from './chunks/coverage.
|
|
8
|
-
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.
|
|
4
|
+
import { V as Vitest, a as VitestPlugin } from './chunks/cli-api.B8xRY9Zt.js';
|
|
5
|
+
export { G as GitNotFoundError, F as TestsNotFoundError, b as VitestPackageInstaller, e as createViteLogger, c as createVitest, i as isValidApiRequest, d as registerConsoleShortcuts, r as resolveFsAllow, s as startVitest } from './chunks/cli-api.B8xRY9Zt.js';
|
|
6
|
+
export { p as parseCLI } from './chunks/cac.CY0IAxC4.js';
|
|
7
|
+
import { r as resolveConfig$2 } from './chunks/coverage.C84l9G-M.js';
|
|
8
|
+
export { b as BaseSequencer, c as createMethodsRPC, g as getFilePoolName, a as resolveApiServerConfig } from './chunks/coverage.C84l9G-M.js';
|
|
9
9
|
import { slash, deepClone } from '@vitest/utils';
|
|
10
10
|
import { f as findUp } from './chunks/index.X0nbfr6-.js';
|
|
11
11
|
import { resolve } from 'pathe';
|
|
@@ -19,7 +19,7 @@ import 'node:path';
|
|
|
19
19
|
import '@vitest/snapshot/manager';
|
|
20
20
|
import 'vite-node/client';
|
|
21
21
|
import 'vite-node/server';
|
|
22
|
-
import './chunks/index.
|
|
22
|
+
import './chunks/index.Bgo3tNWt.js';
|
|
23
23
|
import './chunks/index.Bz6b0Ib7.js';
|
|
24
24
|
import 'node:fs/promises';
|
|
25
25
|
import './chunks/typechecker.CMNPqJOo.js';
|
package/dist/reporters.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aO as BaseReporter, aP as BenchmarkBuiltinReporters, aB as BenchmarkReporter, aC as BenchmarkReportsMap, aQ as BuiltinReporterOptions, aR as BuiltinReporters, aD as DefaultReporter, aE as DotReporter, aF as GithubActionsReporter, aG as HangingProcessReporter, aI as JUnitReporter, aS as JsonAssertionResult, aH as JsonReporter, aT as JsonTestResult, aU as JsonTestResults, ay as ReportedHookContext, az as Reporter, aJ as ReportersMap, aK as TapFlatReporter, aL as TapReporter, aA as TestRunEndReason, aM as VerboseBenchmarkReporter, aN as VerboseReporter } from './chunks/reporters.d.DWg40D2B.js';
|
|
2
2
|
import '@vitest/runner';
|
|
3
3
|
import './chunks/environment.d.Bhm9oc0v.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
5
|
import 'node:stream';
|
|
6
6
|
import 'vite';
|
|
7
7
|
import 'node:console';
|
|
8
|
-
import './chunks/browser.d.
|
|
9
|
-
import './chunks/worker.d.
|
|
8
|
+
import './chunks/browser.d.BRP8scJf.js';
|
|
9
|
+
import './chunks/worker.d.zjyR34Pb.js';
|
|
10
10
|
import './chunks/config.d.DZo8c7fw.js';
|
|
11
11
|
import '@vitest/pretty-format';
|
|
12
12
|
import '@vitest/snapshot';
|
package/dist/runners.js
CHANGED
|
@@ -7,14 +7,14 @@ import { getTests, getNames, getTestName } from '@vitest/runner/utils';
|
|
|
7
7
|
import { processError } from '@vitest/utils/error';
|
|
8
8
|
import { normalize } from 'pathe';
|
|
9
9
|
import { g as getSnapshotClient, i as inject, c as createExpect, v as vi } from './chunks/vi.CA0EPI9Y.js';
|
|
10
|
-
import { r as rpc } from './chunks/rpc.
|
|
10
|
+
import { r as rpc } from './chunks/rpc.jnQO9F8a.js';
|
|
11
11
|
import 'chai';
|
|
12
12
|
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
13
13
|
import '@vitest/snapshot';
|
|
14
14
|
import '@vitest/spy';
|
|
15
15
|
import '@vitest/utils/source-map';
|
|
16
16
|
import './chunks/date.Bq6ZW5rf.js';
|
|
17
|
-
import './chunks/index.
|
|
17
|
+
import './chunks/index.Bgo3tNWt.js';
|
|
18
18
|
|
|
19
19
|
function createBenchmarkResult(name) {
|
|
20
20
|
return {
|
package/dist/worker.js
CHANGED
|
@@ -6,13 +6,13 @@ import { readFileSync } from 'node:fs';
|
|
|
6
6
|
import { resolve, normalize } from 'pathe';
|
|
7
7
|
import { e as environments } from './chunks/index.CmSc2RE5.js';
|
|
8
8
|
import { s as setupInspect } from './chunks/inspector.C914Efll.js';
|
|
9
|
-
import { c as createRuntimeRpc, a as rpcDone } from './chunks/rpc.
|
|
9
|
+
import { c as createRuntimeRpc, a as rpcDone } from './chunks/rpc.jnQO9F8a.js';
|
|
10
10
|
import { i as isChildProcess, s as setProcessTitle } from './chunks/utils.XdZDrNZV.js';
|
|
11
11
|
import { d as disposeInternalListeners } from './chunks/utils.CcGm2cd1.js';
|
|
12
12
|
import 'node:console';
|
|
13
13
|
import 'node:module';
|
|
14
14
|
import '@vitest/utils';
|
|
15
|
-
import './chunks/index.
|
|
15
|
+
import './chunks/index.Bgo3tNWt.js';
|
|
16
16
|
|
|
17
17
|
function isBuiltinEnvironment(env) {
|
|
18
18
|
return env in environments;
|
|
@@ -69,7 +69,7 @@ if (isChildProcess()) {
|
|
|
69
69
|
async function execute(method, ctx) {
|
|
70
70
|
disposeInternalListeners();
|
|
71
71
|
const prepareStart = performance.now();
|
|
72
|
-
const
|
|
72
|
+
const cleanups = [setupInspect(ctx)];
|
|
73
73
|
process.env.VITEST_WORKER_ID = String(ctx.workerId);
|
|
74
74
|
process.env.VITEST_POOL_ID = String(workerId);
|
|
75
75
|
try {
|
|
@@ -82,6 +82,12 @@ async function execute(method, ctx) {
|
|
|
82
82
|
if (!worker.getRpcOptions || typeof worker.getRpcOptions !== "function") throw new TypeError(`Test worker should expose "getRpcOptions" method. Received "${typeof worker.getRpcOptions}".`);
|
|
83
83
|
// RPC is used to communicate between worker (be it a thread worker or child process or a custom implementation) and the main thread
|
|
84
84
|
const { rpc, onCancel } = createRuntimeRpc(worker.getRpcOptions(ctx));
|
|
85
|
+
// do not close the RPC channel so that we can get the error messages sent to the main thread
|
|
86
|
+
cleanups.push(async () => {
|
|
87
|
+
await Promise.all(rpc.$rejectPendingCalls(({ method, reject }) => {
|
|
88
|
+
reject(/* @__PURE__ */ new Error(`[vitest-worker]: Closing rpc while "${method}" was pending`));
|
|
89
|
+
}));
|
|
90
|
+
});
|
|
85
91
|
const beforeEnvironmentTime = performance.now();
|
|
86
92
|
const environment = await loadEnvironment(ctx, rpc);
|
|
87
93
|
if (ctx.environment.transformMode) environment.transformMode = ctx.environment.transformMode;
|
|
@@ -107,8 +113,8 @@ async function execute(method, ctx) {
|
|
|
107
113
|
if (!worker[methodName] || typeof worker[methodName] !== "function") throw new TypeError(`Test worker should expose "runTests" method. Received "${typeof worker.runTests}".`);
|
|
108
114
|
await worker[methodName](state);
|
|
109
115
|
} finally {
|
|
116
|
+
await Promise.all(cleanups.map((fn) => fn()));
|
|
110
117
|
await rpcDone().catch(() => {});
|
|
111
|
-
inspectorCleanup();
|
|
112
118
|
}
|
|
113
119
|
}
|
|
114
120
|
function run(ctx) {
|
package/dist/workers/forks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import v8 from 'node:v8';
|
|
2
|
-
import { r as runBaseTests } from '../chunks/base.
|
|
2
|
+
import { r as runBaseTests } from '../chunks/base.BaCDDRPG.js';
|
|
3
3
|
import { c as createForksRpcOptions, u as unwrapSerializableConfig } from '../chunks/utils.CcGm2cd1.js';
|
|
4
4
|
import 'vite-node/client';
|
|
5
5
|
import '../chunks/execute.Dt-pCVcL.js';
|
|
@@ -6,7 +6,7 @@ import util from 'node:util';
|
|
|
6
6
|
import { startTests, collectTests } from '@vitest/runner';
|
|
7
7
|
import { KNOWN_ASSET_TYPES } from 'vite-node/constants';
|
|
8
8
|
import { installSourcemapsSupport } from 'vite-node/source-map';
|
|
9
|
-
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.
|
|
9
|
+
import { s as setupChaiConfig, r as resolveTestRunner, a as resolveSnapshotEnvironment } from '../chunks/index.CtUvr1c8.js';
|
|
10
10
|
import { c as setupCommonEnv, s as startCoverageInsideWorker, a as stopCoverageInsideWorker } from '../chunks/setup-common.Ebx5x0eP.js';
|
|
11
11
|
import { V as VitestIndex } from '../chunks/index.D1_MsKEt.js';
|
|
12
12
|
import { c as closeInspector } from '../chunks/inspector.C914Efll.js';
|
|
@@ -15,9 +15,9 @@ import 'chai';
|
|
|
15
15
|
import 'node:path';
|
|
16
16
|
import '../path.js';
|
|
17
17
|
import 'node:url';
|
|
18
|
-
import '../chunks/rpc.
|
|
18
|
+
import '../chunks/rpc.jnQO9F8a.js';
|
|
19
19
|
import '@vitest/utils';
|
|
20
|
-
import '../chunks/index.
|
|
20
|
+
import '../chunks/index.Bgo3tNWt.js';
|
|
21
21
|
import '../chunks/coverage.DVF1vEu8.js';
|
|
22
22
|
import '@vitest/snapshot';
|
|
23
23
|
import '../chunks/vi.CA0EPI9Y.js';
|
package/dist/workers/threads.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as runBaseTests } from '../chunks/base.
|
|
1
|
+
import { r as runBaseTests } from '../chunks/base.BaCDDRPG.js';
|
|
2
2
|
import { a as createThreadsRpcOptions } from '../chunks/utils.CcGm2cd1.js';
|
|
3
3
|
import 'vite-node/client';
|
|
4
4
|
import '../chunks/execute.Dt-pCVcL.js';
|
package/dist/workers.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.d.
|
|
1
|
+
import { W as WorkerGlobalState, C as ContextRPC, B as BirpcOptions, R as RuntimeRPC } from './chunks/worker.d.zjyR34Pb.js';
|
|
2
2
|
import { Awaitable } from '@vitest/utils';
|
|
3
3
|
import * as v8 from 'v8';
|
|
4
4
|
import { a as SerializedConfig } from './chunks/config.d.DZo8c7fw.js';
|
|
5
|
-
import { W as WorkerContext } from './chunks/worker.d.
|
|
5
|
+
import { W as WorkerContext } from './chunks/worker.d.C-1AbnVe.js';
|
|
6
6
|
import '@vitest/runner';
|
|
7
7
|
import './chunks/environment.d.Bhm9oc0v.js';
|
|
8
8
|
import '@vitest/snapshot';
|
package/dist/workers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { p as provideWorkerState } from './chunks/utils.XdZDrNZV.js';
|
|
2
2
|
export { collect as collectVitestWorkerTests, run as runVitestWorker } from './worker.js';
|
|
3
|
-
export { r as runBaseTests } from './chunks/base.
|
|
3
|
+
export { r as runBaseTests } from './chunks/base.BaCDDRPG.js';
|
|
4
4
|
export { c as createForksRpcOptions, a as createThreadsRpcOptions, u as unwrapSerializableConfig } from './chunks/utils.CcGm2cd1.js';
|
|
5
5
|
export { r as runVmTests } from './chunks/vm.BUnLJt_P.js';
|
|
6
6
|
import '@vitest/utils';
|
|
@@ -14,8 +14,8 @@ import './chunks/index.CmSc2RE5.js';
|
|
|
14
14
|
import 'node:console';
|
|
15
15
|
import './chunks/inspector.C914Efll.js';
|
|
16
16
|
import 'node:module';
|
|
17
|
-
import './chunks/rpc.
|
|
18
|
-
import './chunks/index.
|
|
17
|
+
import './chunks/rpc.jnQO9F8a.js';
|
|
18
|
+
import './chunks/index.Bgo3tNWt.js';
|
|
19
19
|
import './chunks/execute.Dt-pCVcL.js';
|
|
20
20
|
import 'node:vm';
|
|
21
21
|
import '@vitest/utils/error';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.4",
|
|
5
5
|
"description": "Next generation testing framework powered by Vite",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
|
|
120
120
|
"happy-dom": "*",
|
|
121
121
|
"jsdom": "*",
|
|
122
|
-
"@vitest/browser": "4.0.0-beta.
|
|
123
|
-
"@vitest/ui": "4.0.0-beta.
|
|
122
|
+
"@vitest/browser": "4.0.0-beta.4",
|
|
123
|
+
"@vitest/ui": "4.0.0-beta.4"
|
|
124
124
|
},
|
|
125
125
|
"peerDependenciesMeta": {
|
|
126
126
|
"@edge-runtime/vm": {
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"expect-type": "^1.2.2",
|
|
153
153
|
"magic-string": "^0.30.17",
|
|
154
154
|
"pathe": "^2.0.3",
|
|
155
|
-
"picomatch": "^4.0.
|
|
155
|
+
"picomatch": "^4.0.3",
|
|
156
156
|
"std-env": "^3.9.0",
|
|
157
157
|
"tinybench": "^2.9.0",
|
|
158
158
|
"tinyexec": "^0.3.2",
|
|
@@ -161,14 +161,14 @@
|
|
|
161
161
|
"tinyrainbow": "^2.0.0",
|
|
162
162
|
"vite": "^6.0.0 || ^7.0.0-0",
|
|
163
163
|
"why-is-node-running": "^2.3.0",
|
|
164
|
-
"@vitest/expect": "4.0.0-beta.
|
|
165
|
-
"@vitest/
|
|
166
|
-
"@vitest/
|
|
167
|
-
"@vitest/
|
|
168
|
-
"@vitest/
|
|
169
|
-
"@vitest/
|
|
170
|
-
"vite-node": "4.0.0-beta.
|
|
171
|
-
"@vitest/utils": "4.0.0-beta.
|
|
164
|
+
"@vitest/expect": "4.0.0-beta.4",
|
|
165
|
+
"@vitest/mocker": "4.0.0-beta.4",
|
|
166
|
+
"@vitest/pretty-format": "^4.0.0-beta.4",
|
|
167
|
+
"@vitest/runner": "4.0.0-beta.4",
|
|
168
|
+
"@vitest/spy": "4.0.0-beta.4",
|
|
169
|
+
"@vitest/snapshot": "4.0.0-beta.4",
|
|
170
|
+
"vite-node": "4.0.0-beta.4",
|
|
171
|
+
"@vitest/utils": "4.0.0-beta.4"
|
|
172
172
|
},
|
|
173
173
|
"devDependencies": {
|
|
174
174
|
"@ampproject/remapping": "^2.3.0",
|
|
@@ -181,12 +181,12 @@
|
|
|
181
181
|
"@types/istanbul-reports": "^3.0.4",
|
|
182
182
|
"@types/jsdom": "^21.1.7",
|
|
183
183
|
"@types/mime": "^4.0.0",
|
|
184
|
-
"@types/node": "^22.16.
|
|
185
|
-
"@types/picomatch": "^4.0.
|
|
184
|
+
"@types/node": "^22.16.5",
|
|
185
|
+
"@types/picomatch": "^4.0.1",
|
|
186
186
|
"@types/prompts": "^2.4.9",
|
|
187
187
|
"@types/sinonjs__fake-timers": "^8.1.5",
|
|
188
188
|
"acorn-walk": "^8.3.4",
|
|
189
|
-
"birpc": "2.
|
|
189
|
+
"birpc": "^2.5.0",
|
|
190
190
|
"cac": "^6.7.14",
|
|
191
191
|
"chai-subset": "^1.6.0",
|
|
192
192
|
"find-up": "^6.3.0",
|