vitest 4.1.0-beta.6 → 4.1.0
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.js +1 -1
- package/dist/chunks/{base.C98-6XAz.js → base.DM0-RqVb.js} +8 -8
- package/dist/chunks/{cac.Vtz91O0H.js → cac.CWGDZnXT.js} +6 -6
- package/dist/chunks/{cli-api.Bqj5xGy5.js → cli-api.DuT9iuvY.js} +49 -25
- package/dist/chunks/{coverage.DUqi2f6q.js → coverage.Bri33R1t.js} +3 -3
- package/dist/chunks/{defaults.BlJmGxXD.js → defaults.CdU2lD-q.js} +2 -2
- package/dist/chunks/{globals.DA6L6i5h.js → globals.BXNGLnTL.js} +2 -2
- package/dist/chunks/{index.CHsi7RlU.js → index.CEzQDJGb.js} +1 -1
- package/dist/chunks/{index.5lgR0kvt.js → index.DGNSnENe.js} +2 -2
- package/dist/chunks/{index.DpkD7Zj4.js → index.DXMFO5MJ.js} +426 -393
- package/dist/chunks/{index.IcAjQV7n.js → index.DlDSLQD3.js} +1 -1
- package/dist/chunks/{init-forks.BwPkXyLk.js → init-forks.DeArv0jT.js} +1 -1
- package/dist/chunks/{init-threads.BuSVu8Ns.js → init-threads.-2OUl4Nn.js} +1 -1
- package/dist/chunks/{init.Borgldul.js → init.DICorXCo.js} +1 -1
- package/dist/chunks/{native.mV0-490A.js → native.DPzPHdi5.js} +1 -1
- package/dist/chunks/{nativeModuleMocker.wQT5wU7r.js → nativeModuleMocker.DndvSdL6.js} +1 -1
- package/dist/chunks/{plugin.d.pmonRL8Y.d.ts → plugin.d.BuW-flqo.d.ts} +1 -1
- package/dist/chunks/{reporters.d.CRDGoPlb.d.ts → reporters.d.DVUYHHhe.d.ts} +15 -3
- package/dist/chunks/{setup-common.z3ZfZiWN.js → setup-common.B41N_kPE.js} +1 -1
- package/dist/chunks/{startVitestModuleRunner.BdSYEN5x.js → startVitestModuleRunner.C3ZR-4J3.js} +1 -1
- package/dist/chunks/{test.PnxXDGpZ.js → test.CTcmp4Su.js} +2 -0
- package/dist/chunks/{vm.V092iA4c.js → vm.Dh2rTtmP.js} +2 -2
- package/dist/cli.js +3 -3
- package/dist/config.cjs +1 -1
- package/dist/config.d.ts +3 -3
- package/dist/config.js +1 -1
- package/dist/coverage.d.ts +1 -1
- package/dist/coverage.js +2 -2
- package/dist/index.js +2 -2
- package/dist/node.d.ts +3 -3
- package/dist/node.js +8 -8
- package/dist/nodejs-worker-loader.js +1 -1
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +4 -4
- package/dist/runners.js +1 -1
- package/dist/runtime.js +1 -1
- package/dist/worker.js +7 -7
- package/dist/workers/forks.js +8 -8
- package/dist/workers/runVmTests.js +4 -4
- package/dist/workers/threads.js +8 -8
- package/dist/workers/vmForks.js +4 -4
- package/dist/workers/vmThreads.js +4 -4
- package/package.json +16 -16
package/dist/browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv, b as startCoverageInsideWorker, c as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.
|
|
1
|
+
export { l as loadDiffConfig, a as loadSnapshotSerializers, s as setupCommonEnv, b as startCoverageInsideWorker, c as stopCoverageInsideWorker, t as takeCoverageInsideWorker } from './chunks/setup-common.B41N_kPE.js';
|
|
2
2
|
export { T as Traces } from './chunks/traces.CCmnQaNT.js';
|
|
3
3
|
export { collectTests, startTests } from '@vitest/runner';
|
|
4
4
|
import * as spyModule from '@vitest/spy';
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { runInThisContext } from 'node:vm';
|
|
2
2
|
import * as spyModule from '@vitest/spy';
|
|
3
|
-
import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.
|
|
4
|
-
import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.
|
|
3
|
+
import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.DGNSnENe.js';
|
|
4
|
+
import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.DICorXCo.js';
|
|
5
5
|
import { N as NativeModuleRunner } from './nativeModuleRunner.BIakptoF.js';
|
|
6
6
|
import { T as Traces } from './traces.CCmnQaNT.js';
|
|
7
7
|
import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
|
|
8
|
-
import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startVitestModuleRunner.
|
|
8
|
+
import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startVitestModuleRunner.C3ZR-4J3.js';
|
|
9
9
|
import { performance as performance$1 } from 'node:perf_hooks';
|
|
10
10
|
import { startTests, collectTests } from '@vitest/runner';
|
|
11
|
-
import { s as setupCommonEnv, b as startCoverageInsideWorker, c as stopCoverageInsideWorker } from './setup-common.
|
|
12
|
-
import { g as globalExpect, v as vi } from './test.
|
|
11
|
+
import { s as setupCommonEnv, b as startCoverageInsideWorker, c as stopCoverageInsideWorker } from './setup-common.B41N_kPE.js';
|
|
12
|
+
import { g as globalExpect, v as vi } from './test.CTcmp4Su.js';
|
|
13
13
|
import { c as closeInspector } from './inspector.CvyFGlXm.js';
|
|
14
14
|
import { createRequire } from 'node:module';
|
|
15
15
|
import timers from 'node:timers';
|
|
16
16
|
import timersPromises from 'node:timers/promises';
|
|
17
17
|
import util from 'node:util';
|
|
18
18
|
import { KNOWN_ASSET_TYPES } from '@vitest/utils/constants';
|
|
19
|
-
import { i as index } from './index.
|
|
19
|
+
import { i as index } from './index.DlDSLQD3.js';
|
|
20
20
|
import { g as getWorkerState, r as resetModules, p as provideWorkerState, a as getSafeWorkerState } from './utils.BX5Fg8C4.js';
|
|
21
21
|
|
|
22
22
|
// this should only be used in Node
|
|
@@ -115,7 +115,7 @@ async function startModuleRunner(options) {
|
|
|
115
115
|
let mocker;
|
|
116
116
|
if (options.state.config.experimental.nodeLoader !== false) {
|
|
117
117
|
// this additionally imports acorn/magic-string
|
|
118
|
-
const { NativeModuleMocker } = await import('./nativeModuleMocker.
|
|
118
|
+
const { NativeModuleMocker } = await import('./nativeModuleMocker.DndvSdL6.js');
|
|
119
119
|
mocker = new NativeModuleMocker({
|
|
120
120
|
async resolveId(id, importer) {
|
|
121
121
|
// TODO: use import.meta.resolve instead
|
|
@@ -141,7 +141,7 @@ let _environmentTime;
|
|
|
141
141
|
/** @experimental */
|
|
142
142
|
async function setupBaseEnvironment(context) {
|
|
143
143
|
if (context.config.experimental.viteModuleRunner === false) {
|
|
144
|
-
const { setupNodeLoaderHooks } = await import('./native.
|
|
144
|
+
const { setupNodeLoaderHooks } = await import('./native.DPzPHdi5.js');
|
|
145
145
|
await setupNodeLoaderHooks(context);
|
|
146
146
|
}
|
|
147
147
|
const startTime = performance.now();
|
|
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
|
|
|
3
3
|
import { normalize } from 'pathe';
|
|
4
4
|
import c$2 from 'tinyrainbow';
|
|
5
5
|
import { b as defaultPort, d as defaultBrowserPort } from './constants.CPYnjOGj.js';
|
|
6
|
-
import { R as ReportersMap } from './index.
|
|
6
|
+
import { R as ReportersMap } from './index.DXMFO5MJ.js';
|
|
7
7
|
import assert from 'node:assert';
|
|
8
8
|
|
|
9
9
|
function toArr(any) {
|
|
@@ -620,7 +620,7 @@ class CAC extends EventEmitter {
|
|
|
620
620
|
|
|
621
621
|
const cac = (name = "") => new CAC(name);
|
|
622
622
|
|
|
623
|
-
var version = "4.1.0
|
|
623
|
+
var version = "4.1.0";
|
|
624
624
|
|
|
625
625
|
const apiConfig = (port) => ({
|
|
626
626
|
port: {
|
|
@@ -2312,11 +2312,11 @@ function normalizeCliOptions(cliFilters, argv) {
|
|
|
2312
2312
|
}
|
|
2313
2313
|
async function start(mode, cliFilters, options) {
|
|
2314
2314
|
try {
|
|
2315
|
-
const { startVitest } = await import('./cli-api.
|
|
2315
|
+
const { startVitest } = await import('./cli-api.DuT9iuvY.js').then(function (n) { return n.q; });
|
|
2316
2316
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
2317
2317
|
if (!ctx.shouldKeepServer()) await ctx.exit();
|
|
2318
2318
|
} catch (e) {
|
|
2319
|
-
const { errorBanner } = await import('./index.
|
|
2319
|
+
const { errorBanner } = await import('./index.DXMFO5MJ.js').then(function (n) { return n.C; });
|
|
2320
2320
|
console.error(`\n${errorBanner("Startup Error")}`);
|
|
2321
2321
|
console.error(e);
|
|
2322
2322
|
console.error("\n\n");
|
|
@@ -2334,7 +2334,7 @@ async function init(project) {
|
|
|
2334
2334
|
}
|
|
2335
2335
|
async function collect(mode, cliFilters, options) {
|
|
2336
2336
|
try {
|
|
2337
|
-
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.
|
|
2337
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.DuT9iuvY.js').then(function (n) { return n.q; });
|
|
2338
2338
|
const ctx = await prepareVitest(mode, {
|
|
2339
2339
|
...normalizeCliOptions(cliFilters, options),
|
|
2340
2340
|
watch: false,
|
|
@@ -2356,7 +2356,7 @@ async function collect(mode, cliFilters, options) {
|
|
|
2356
2356
|
} else outputFileList(await ctx.getRelevantTestSpecifications(cliFilters.map(normalize)), options);
|
|
2357
2357
|
await ctx.close();
|
|
2358
2358
|
} catch (e) {
|
|
2359
|
-
const { errorBanner } = await import('./index.
|
|
2359
|
+
const { errorBanner } = await import('./index.DXMFO5MJ.js').then(function (n) { return n.C; });
|
|
2360
2360
|
console.error(`\n${errorBanner("Collect Error")}`);
|
|
2361
2361
|
console.error(e);
|
|
2362
2362
|
console.error("\n\n");
|
|
@@ -13,13 +13,13 @@ import nodeos__default, { tmpdir } from 'node:os';
|
|
|
13
13
|
import { generateHash as generateHash$1, createTaskName, validateTags, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, hasFailed, generateFileHash, limitConcurrency, createFileTask as createFileTask$1, getTasks, isTestCase } from '@vitest/runner/utils';
|
|
14
14
|
import { SnapshotManager } from '@vitest/snapshot/manager';
|
|
15
15
|
import { serializeValue } from '@vitest/utils/serialize';
|
|
16
|
-
import { v as version$1 } from './cac.
|
|
16
|
+
import { v as version$1 } from './cac.CWGDZnXT.js';
|
|
17
17
|
import { rootDir, distDir } from '../path.js';
|
|
18
|
-
import { d as createIndexLocationsMap, e as TraceMap, o as originalPositionFor, h as ancestor, i as stringify, p as parse, j as printError, f as formatProjectName, w as withLabel, k as errorBanner, l as divider, m as Typechecker, n as generateCodeFrame, q as escapeRegExp, r as createDefinesScript, R as ReportersMap, u as groupBy, B as BlobReporter, v as readBlobs, x as convertTasksToEvents, H as HangingProcessReporter, y as wildcardPatternToRegExp, z as stdout } from './index.
|
|
18
|
+
import { d as createIndexLocationsMap, e as TraceMap, o as originalPositionFor, h as ancestor, i as stringify, p as parse, j as printError, f as formatProjectName, w as withLabel, k as errorBanner, l as divider, m as Typechecker, n as generateCodeFrame, q as escapeRegExp, r as createDefinesScript, R as ReportersMap, u as groupBy, B as BlobReporter, v as readBlobs, x as convertTasksToEvents, H as HangingProcessReporter, y as wildcardPatternToRegExp, z as stdout } from './index.DXMFO5MJ.js';
|
|
19
19
|
import { N as NativeModuleRunner } from './nativeModuleRunner.BIakptoF.js';
|
|
20
20
|
import { T as Traces } from './traces.CCmnQaNT.js';
|
|
21
21
|
import { createDebug } from 'obug';
|
|
22
|
-
import { h as hash, R as RandomSequencer, i as isBrowserEnabled, r as resolveConfig, g as getCoverageProvider, b as resolveApiServerConfig } from './coverage.
|
|
22
|
+
import { h as hash, R as RandomSequencer, i as isBrowserEnabled, r as resolveConfig, g as getCoverageProvider, b as resolveApiServerConfig } from './coverage.Bri33R1t.js';
|
|
23
23
|
import { rm, readFile, writeFile, rename, stat, unlink, mkdir, copyFile } from 'node:fs/promises';
|
|
24
24
|
import c from 'tinyrainbow';
|
|
25
25
|
import { VitestModuleEvaluator } from '#module-evaluator';
|
|
@@ -49,13 +49,13 @@ import require$$0$2 from 'stream';
|
|
|
49
49
|
import require$$7 from 'url';
|
|
50
50
|
import require$$0 from 'zlib';
|
|
51
51
|
import require$$0$1 from 'buffer';
|
|
52
|
-
import { c as configDefaults } from './defaults.
|
|
52
|
+
import { c as configDefaults } from './defaults.CdU2lD-q.js';
|
|
53
53
|
import MagicString from 'magic-string';
|
|
54
54
|
import { hoistMocksPlugin, automockPlugin } from '@vitest/mocker/node';
|
|
55
55
|
import { KNOWN_ASSET_RE } from '@vitest/utils/constants';
|
|
56
56
|
import { findNearestPackageData } from '@vitest/utils/resolver';
|
|
57
57
|
import * as esModuleLexer from 'es-module-lexer';
|
|
58
|
-
import { a as BenchmarkReportsMap } from './index.
|
|
58
|
+
import { a as BenchmarkReportsMap } from './index.CEzQDJGb.js';
|
|
59
59
|
import assert$1 from 'node:assert';
|
|
60
60
|
import { parseErrorStacktrace } from '@vitest/utils/source-map';
|
|
61
61
|
import { extractSourcemapFromFile } from '@vitest/utils/source-map/node';
|
|
@@ -136,8 +136,8 @@ function astParseFile(filepath, code) {
|
|
|
136
136
|
if (callee.type === "MemberExpression") {
|
|
137
137
|
if (callee.object?.type === "Identifier" && isVitestFunctionName(callee.object.name)) return callee.object?.name;
|
|
138
138
|
if (callee.object?.name?.startsWith("__vite_ssr_") || callee.object?.object?.name?.startsWith("__vite_ssr_") && callee.object?.property?.name === "Vitest") return getName(callee.property);
|
|
139
|
-
// call as `__vite_ssr__.test.skip()`
|
|
140
|
-
return getName(callee.object
|
|
139
|
+
// call as `__vite_ssr__.test.skip()` or `describe.concurrent.each()`
|
|
140
|
+
return getName(callee.object);
|
|
141
141
|
}
|
|
142
142
|
// unwrap (0, ...)
|
|
143
143
|
if (callee.type === "SequenceExpression" && callee.expressions.length === 2) {
|
|
@@ -146,6 +146,18 @@ function astParseFile(filepath, code) {
|
|
|
146
146
|
}
|
|
147
147
|
return null;
|
|
148
148
|
};
|
|
149
|
+
const getProperties = (callee) => {
|
|
150
|
+
if (!callee) return [];
|
|
151
|
+
if (callee.type === "Identifier") return [];
|
|
152
|
+
if (callee.type === "CallExpression") return getProperties(callee.callee);
|
|
153
|
+
if (callee.type === "TaggedTemplateExpression") return getProperties(callee.tag);
|
|
154
|
+
if (callee.type === "MemberExpression") {
|
|
155
|
+
const props = getProperties(callee.object);
|
|
156
|
+
if (callee.property?.name) props.push(callee.property.name);
|
|
157
|
+
return props;
|
|
158
|
+
}
|
|
159
|
+
return [];
|
|
160
|
+
};
|
|
149
161
|
ancestor(ast, { CallExpression(node) {
|
|
150
162
|
const { callee } = node;
|
|
151
163
|
const name = getName(callee);
|
|
@@ -154,10 +166,10 @@ function astParseFile(filepath, code) {
|
|
|
154
166
|
verbose?.(`Skipping ${name} (unknown call)`);
|
|
155
167
|
return;
|
|
156
168
|
}
|
|
169
|
+
const properties = getProperties(callee);
|
|
157
170
|
const property = callee?.property?.name;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if ([
|
|
171
|
+
// intermediate calls like .each(), .for() will be picked up in the next iteration
|
|
172
|
+
if (property && [
|
|
161
173
|
"each",
|
|
162
174
|
"for",
|
|
163
175
|
"skipIf",
|
|
@@ -165,7 +177,13 @@ function astParseFile(filepath, code) {
|
|
|
165
177
|
"extend",
|
|
166
178
|
"scoped",
|
|
167
179
|
"override"
|
|
168
|
-
].includes(
|
|
180
|
+
].includes(property)) return;
|
|
181
|
+
// derive mode from the full chain (handles any order like .skip.concurrent or .concurrent.skip)
|
|
182
|
+
let mode = "run";
|
|
183
|
+
for (const prop of properties) if (prop === "skip" || prop === "only" || prop === "todo") mode = prop;
|
|
184
|
+
else if (prop === "skipIf" || prop === "runIf") mode = "skip";
|
|
185
|
+
let isConcurrent = properties.includes("concurrent");
|
|
186
|
+
let isSequential = properties.includes("sequential");
|
|
169
187
|
let start;
|
|
170
188
|
const end = node.end;
|
|
171
189
|
// .each or (0, __vite_ssr_exports_0__.test)()
|
|
@@ -184,28 +202,28 @@ function astParseFile(filepath, code) {
|
|
|
184
202
|
}
|
|
185
203
|
if (message.startsWith("0,")) message = message.slice(2);
|
|
186
204
|
message = message.replace(/\(0\s?,\s?__vite_ssr_import_\d+__.(\w+)\)/g, "$1").replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "").replace(/__vi_import_\d+__\./g, "");
|
|
187
|
-
// cannot statically analyze, so we always skip it
|
|
188
|
-
if (mode === "skipIf" || mode === "runIf") mode = "skip";
|
|
189
205
|
const parentCalleeName = typeof callee?.callee === "object" && callee?.callee.type === "MemberExpression" && callee?.callee.property?.name;
|
|
190
206
|
let isDynamicEach = parentCalleeName === "each" || parentCalleeName === "for";
|
|
191
207
|
if (!isDynamicEach && callee.type === "TaggedTemplateExpression") {
|
|
192
208
|
const property = callee.tag?.property?.name;
|
|
193
209
|
isDynamicEach = property === "each" || property === "for";
|
|
194
210
|
}
|
|
195
|
-
// Extract
|
|
211
|
+
// Extract options from the second argument if it's an options object
|
|
196
212
|
const tags = [];
|
|
197
213
|
const secondArg = node.arguments?.[1];
|
|
198
|
-
if (secondArg?.type === "ObjectExpression") {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
tags.push(tagsValue.value);
|
|
214
|
+
if (secondArg?.type === "ObjectExpression") for (const prop of secondArg.properties || []) {
|
|
215
|
+
if (prop.type !== "Property" || prop.key?.type !== "Identifier") continue;
|
|
216
|
+
const keyName = prop.key.name;
|
|
217
|
+
if (keyName === "tags") {
|
|
218
|
+
const tagsValue = prop.value;
|
|
219
|
+
if (tagsValue?.type === "Literal" && typeof tagsValue.value === "string") tags.push(tagsValue.value);
|
|
205
220
|
else if (tagsValue?.type === "ArrayExpression") {
|
|
206
|
-
// tags: ['tag1', 'tag2']
|
|
207
221
|
for (const element of tagsValue.elements || []) if (element?.type === "Literal" && typeof element.value === "string") tags.push(element.value);
|
|
208
222
|
}
|
|
223
|
+
} else if (prop.value?.type === "Literal" && prop.value.value === true) {
|
|
224
|
+
if (keyName === "skip" || keyName === "only" || keyName === "todo") mode = keyName;
|
|
225
|
+
else if (keyName === "concurrent") isConcurrent = true;
|
|
226
|
+
else if (keyName === "sequential") isSequential = true;
|
|
209
227
|
}
|
|
210
228
|
}
|
|
211
229
|
debug$1?.("Found", name, message, `(${mode})`, tags.length ? `[${tags.join(", ")}]` : "");
|
|
@@ -217,6 +235,8 @@ function astParseFile(filepath, code) {
|
|
|
217
235
|
mode,
|
|
218
236
|
task: null,
|
|
219
237
|
dynamic: isDynamicEach,
|
|
238
|
+
concurrent: isConcurrent,
|
|
239
|
+
sequential: isSequential,
|
|
220
240
|
tags
|
|
221
241
|
});
|
|
222
242
|
} });
|
|
@@ -311,6 +331,8 @@ function createFileTask(testFilepath, code, requestMap, config, filepath, fileTa
|
|
|
311
331
|
} else debug$1?.("Cannot find original location for", definition.type, definition.name, `${processedLocation.column}:${processedLocation.line}`);
|
|
312
332
|
} else debug$1?.("Cannot find original location for", definition.type, definition.name, `${definition.start}`);
|
|
313
333
|
const taskTags = unique([...latestSuite.tags || [], ...definition.tags]);
|
|
334
|
+
// resolve concurrent/sequential: sequential cancels inherited concurrent
|
|
335
|
+
const concurrent = definition.sequential ? void 0 : definition.concurrent || latestSuite.concurrent || void 0;
|
|
314
336
|
if (definition.type === "suite") {
|
|
315
337
|
const task = {
|
|
316
338
|
type: definition.type,
|
|
@@ -320,6 +342,7 @@ function createFileTask(testFilepath, code, requestMap, config, filepath, fileTa
|
|
|
320
342
|
tasks: [],
|
|
321
343
|
mode,
|
|
322
344
|
each: definition.dynamic,
|
|
345
|
+
concurrent,
|
|
323
346
|
name: definition.name,
|
|
324
347
|
fullName: createTaskName([latestSuite.fullName, definition.name]),
|
|
325
348
|
fullTestName: createTaskName([latestSuite.fullTestName, definition.name]),
|
|
@@ -342,6 +365,7 @@ function createFileTask(testFilepath, code, requestMap, config, filepath, fileTa
|
|
|
342
365
|
suite: latestSuite,
|
|
343
366
|
file,
|
|
344
367
|
each: definition.dynamic,
|
|
368
|
+
concurrent,
|
|
345
369
|
mode,
|
|
346
370
|
context: {},
|
|
347
371
|
name: definition.name,
|
|
@@ -1178,7 +1202,7 @@ function getCachedResult(result, tmp) {
|
|
|
1178
1202
|
invalidate: result.invalidate
|
|
1179
1203
|
};
|
|
1180
1204
|
}
|
|
1181
|
-
const MODULE_RUNNER_SOURCEMAPPING_REGEXP =
|
|
1205
|
+
const MODULE_RUNNER_SOURCEMAPPING_REGEXP = new RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
|
|
1182
1206
|
function extractSourceMap(code) {
|
|
1183
1207
|
const pattern = `//# ${SOURCEMAPPING_URL}=data:application/json;base64,`;
|
|
1184
1208
|
const lastIndex = code.lastIndexOf(pattern);
|
|
@@ -9894,7 +9918,7 @@ function silenceImportViteIgnoreWarning(logger) {
|
|
|
9894
9918
|
|
|
9895
9919
|
const cssLangs = "\\.(?:css|less|sass|scss|styl|stylus|pcss|postcss)(?:$|\\?)";
|
|
9896
9920
|
const cssLangRE = new RegExp(cssLangs);
|
|
9897
|
-
const cssModuleRE =
|
|
9921
|
+
const cssModuleRE = new RegExp(`\\.module${cssLangs}`);
|
|
9898
9922
|
const cssInlineRE = /[?&]inline(?:&|$)/;
|
|
9899
9923
|
function isCSS(id) {
|
|
9900
9924
|
return cssLangRE.test(id);
|
|
@@ -10177,7 +10201,7 @@ function processWildcard(dep, moduleDirectories) {
|
|
|
10177
10201
|
if (typeof dep !== "string") return dep;
|
|
10178
10202
|
if (typeof dep === "string" && dep.includes("*")) {
|
|
10179
10203
|
const directories = (moduleDirectories || ["/node_modules/"]).map((r) => escapeRegExp(r));
|
|
10180
|
-
return
|
|
10204
|
+
return new RegExp(`(${directories.join("|")})${dep.replace(/\*/g, "[\\w/]+")}`);
|
|
10181
10205
|
}
|
|
10182
10206
|
return dep;
|
|
10183
10207
|
}
|
|
@@ -7,14 +7,14 @@ import { resolve, relative, normalize } from 'pathe';
|
|
|
7
7
|
import pm from 'picomatch';
|
|
8
8
|
import { glob } from 'tinyglobby';
|
|
9
9
|
import c from 'tinyrainbow';
|
|
10
|
-
import { c as configDefaults, e as benchmarkConfigDefaults, a as coverageConfigDefaults } from './defaults.
|
|
10
|
+
import { c as configDefaults, e as benchmarkConfigDefaults, a as coverageConfigDefaults } from './defaults.CdU2lD-q.js';
|
|
11
11
|
import crypto from 'node:crypto';
|
|
12
12
|
import { r as resolveModule } from './index.BCY_7LL2.js';
|
|
13
13
|
import { mergeConfig } from 'vite';
|
|
14
14
|
import { c as configFiles, d as defaultBrowserPort, a as defaultInspectPort, b as defaultPort } from './constants.CPYnjOGj.js';
|
|
15
15
|
import './env.D4Lgay0q.js';
|
|
16
16
|
import nodeos__default from 'node:os';
|
|
17
|
-
import { isCI, provider } from 'std-env';
|
|
17
|
+
import { isCI, isAgent, provider } from 'std-env';
|
|
18
18
|
import { r as resolveCoverageProviderModule } from './coverage.D_JHT54q.js';
|
|
19
19
|
|
|
20
20
|
const hash = crypto.hash ?? ((algorithm, data, outputEncoding) => crypto.createHash(algorithm).update(data).digest(outputEncoding));
|
|
@@ -430,7 +430,7 @@ function resolveConfig$1(vitest, options, viteConfig) {
|
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
if (!resolved.reporters.length) {
|
|
433
|
-
resolved.reporters.push(["default", {}]);
|
|
433
|
+
resolved.reporters.push([isAgent ? "agent" : "default", {}]);
|
|
434
434
|
// also enable github-actions reporter as a default
|
|
435
435
|
if (process.env.GITHUB_ACTIONS === "true") resolved.reporters.push(["github-actions", {}]);
|
|
436
436
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import nodeos__default from 'node:os';
|
|
2
2
|
import './env.D4Lgay0q.js';
|
|
3
|
-
import { isCI } from 'std-env';
|
|
3
|
+
import { isCI, isAgent } from 'std-env';
|
|
4
4
|
|
|
5
5
|
const defaultInclude = ["**/*.{test,spec}.?(c|m)[jt]s?(x)"];
|
|
6
6
|
const defaultExclude = ["**/node_modules/**", "**/.git/**"];
|
|
@@ -37,7 +37,7 @@ const fakeTimersDefaults = {
|
|
|
37
37
|
const configDefaults = Object.freeze({
|
|
38
38
|
allowOnly: !isCI,
|
|
39
39
|
isolate: true,
|
|
40
|
-
watch: !isCI && process.stdin.isTTY,
|
|
40
|
+
watch: !isCI && process.stdin.isTTY && !isAgent,
|
|
41
41
|
globals: false,
|
|
42
42
|
environment: "node",
|
|
43
43
|
clearMocks: false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as globalApis } from './constants.CPYnjOGj.js';
|
|
2
|
-
import { i as index } from './index.
|
|
3
|
-
import './test.
|
|
2
|
+
import { i as index } from './index.DlDSLQD3.js';
|
|
3
|
+
import './test.CTcmp4Su.js';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import '@vitest/utils/helpers';
|
|
6
6
|
import '@vitest/utils/timers';
|
|
@@ -2,7 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import { getTasks, getFullName, getTests } from '@vitest/runner/utils';
|
|
3
3
|
import * as pathe from 'pathe';
|
|
4
4
|
import c from 'tinyrainbow';
|
|
5
|
-
import { g as getStateSymbol, t as truncateString, F as F_RIGHT, D as DefaultReporter, f as formatProjectName, s as separator } from './index.
|
|
5
|
+
import { g as getStateSymbol, t as truncateString, F as F_RIGHT, D as DefaultReporter, f as formatProjectName, s as separator } from './index.DXMFO5MJ.js';
|
|
6
6
|
import { stripVTControlCharacters } from 'node:util';
|
|
7
7
|
import { notNullish } from '@vitest/utils/helpers';
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { chai } from '@vitest/expect';
|
|
2
2
|
import { createHook } from 'node:async_hooks';
|
|
3
|
-
import { l as loadDiffConfig, a as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.
|
|
3
|
+
import { l as loadDiffConfig, a as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.B41N_kPE.js';
|
|
4
4
|
import { r as rpc } from './rpc.MzXet3jl.js';
|
|
5
5
|
import { g as getWorkerState } from './utils.BX5Fg8C4.js';
|
|
6
|
-
import { T as TestRunner, N as NodeBenchmarkRunner } from './test.
|
|
6
|
+
import { T as TestRunner, N as NodeBenchmarkRunner } from './test.CTcmp4Su.js';
|
|
7
7
|
|
|
8
8
|
function setupChaiConfig(config) {
|
|
9
9
|
Object.assign(chai.config, config);
|