vitest 4.1.2 → 4.1.3
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/browser.js +1 -1
- package/dist/chunks/{base.BPik1OqN.js → base.C3wvLFNM.js} +4 -4
- package/dist/chunks/{browser.d.BMOr_Kmk.d.ts → browser.d.C0zGu1u9.d.ts} +1 -1
- package/dist/chunks/{cac.DRKYQDPl.js → cac.Bb7YBzMA.js} +17 -5
- package/dist/chunks/{cli-api.Bxr1Nn49.js → cli-api.CaPRsymo.js} +42 -11
- package/dist/chunks/{config.d.Cz9kPrQs.d.ts → config.d.ChUh6-ad.d.ts} +1 -0
- package/dist/chunks/{coverage.kqM80boz.js → coverage.CwUlQe0s.js} +1 -0
- package/dist/chunks/{global.d.x-ILCfAE.d.ts → global.d.D74z04P1.d.ts} +2 -0
- package/dist/chunks/{globals.CVqIbOyt.js → globals.7B-4LHAF.js} +3 -3
- package/dist/chunks/{index.DOa3dzoN.js → index.4L3g53iW.js} +2 -1
- package/dist/chunks/{index.nZ2xqFgD.js → index.Cj9kDiDi.js} +2 -2
- package/dist/chunks/{index.0GYC6HAu.js → index.DICur-LY.js} +1 -0
- package/dist/chunks/{plugin.d.BWbK_Jpw.d.ts → plugin.d.BssAumYw.d.ts} +1 -1
- package/dist/chunks/{reporters.d.B0uk8id2.d.ts → reporters.d.yJ2fBir5.d.ts} +14 -3
- package/dist/chunks/{setup-common.2wZXQUjS.js → setup-common.NdrZGMhw.js} +1 -1
- package/dist/chunks/{test.p_J6dB8a.js → test.BmQO5GaM.js} +401 -335
- package/dist/chunks/{vm.BvVhnZPV.js → vm.DVLYObm9.js} +5 -4
- package/dist/chunks/{worker.d.BT5j8dyR.d.ts → worker.d.CckNUvI5.d.ts} +1 -1
- package/dist/cli.js +1 -1
- package/dist/config.d.ts +6 -6
- package/dist/coverage.d.ts +4 -4
- package/dist/coverage.js +1 -1
- package/dist/index.d.ts +79 -9
- package/dist/index.js +3 -3
- package/dist/node.d.ts +8 -8
- package/dist/node.js +6 -6
- package/dist/reporters.d.ts +4 -4
- package/dist/reporters.js +1 -1
- package/dist/runners.d.ts +1 -1
- package/dist/runners.js +2 -2
- package/dist/worker.d.ts +2 -2
- package/dist/worker.js +5 -5
- package/dist/workers/forks.js +5 -5
- package/dist/workers/runVmTests.js +4 -4
- package/dist/workers/threads.js +5 -5
- package/dist/workers/vmForks.js +1 -1
- package/dist/workers/vmThreads.js +1 -1
- package/package.json +20 -12
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.d.
|
|
1
|
+
import { a as SerializedCoverageConfig, S as SerializedConfig } from './chunks/config.d.ChUh6-ad.js';
|
|
2
2
|
import { R as RuntimeCoverageModuleLoader } from './chunks/coverage.d.BZtK59WP.js';
|
|
3
3
|
import { SerializedDiffOptions } from '@vitest/utils/diff';
|
|
4
4
|
export { O as OTELCarrier, T as Traces } from './chunks/traces.d.402V_yFI.js';
|
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.NdrZGMhw.js';
|
|
2
2
|
export { T as Traces } from './chunks/traces.DT5aQ62U.js';
|
|
3
3
|
export { collectTests, startTests } from '@vitest/runner';
|
|
4
4
|
import * as spyModule from '@vitest/spy';
|
|
@@ -1,6 +1,6 @@
|
|
|
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.
|
|
3
|
+
import { r as resolveTestRunner, a as resolveSnapshotEnvironment, d as detectAsyncLeaks, s as setupChaiConfig } from './index.Cj9kDiDi.js';
|
|
4
4
|
import { l as loadEnvironment, e as emitModuleRunner, a as listenForErrors } from './init.D98-gwRW.js';
|
|
5
5
|
import { N as NativeModuleRunner } from './nativeModuleRunner.BIakptoF.js';
|
|
6
6
|
import { T as Traces } from './traces.DT5aQ62U.js';
|
|
@@ -8,15 +8,15 @@ import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
|
|
|
8
8
|
import { s as startVitestModuleRunner, c as createNodeImportMeta } from './startVitestModuleRunner.bRl2_oI_.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.NdrZGMhw.js';
|
|
12
|
+
import { g as globalExpect, v as vi } from './test.BmQO5GaM.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.4L3g53iW.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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileSpecification } from '@vitest/runner';
|
|
2
2
|
import { O as OTELCarrier } from './traces.d.402V_yFI.js';
|
|
3
|
-
import { T as TestExecutionMethod } from './worker.d.
|
|
3
|
+
import { T as TestExecutionMethod } from './worker.d.CckNUvI5.js';
|
|
4
4
|
|
|
5
5
|
type SerializedTestSpecification = [project: {
|
|
6
6
|
name: string | undefined;
|
|
@@ -621,7 +621,7 @@ class CAC extends EventEmitter {
|
|
|
621
621
|
|
|
622
622
|
const cac = (name = "") => new CAC(name);
|
|
623
623
|
|
|
624
|
-
var version = "4.1.
|
|
624
|
+
var version = "4.1.3";
|
|
625
625
|
|
|
626
626
|
const apiConfig = (port) => ({
|
|
627
627
|
port: {
|
|
@@ -891,7 +891,18 @@ const cliOptionsConfig = {
|
|
|
891
891
|
viewport: null,
|
|
892
892
|
screenshotDirectory: null,
|
|
893
893
|
screenshotFailures: null,
|
|
894
|
-
locators:
|
|
894
|
+
locators: {
|
|
895
|
+
description: "Options for how locators should be handled by default",
|
|
896
|
+
argument: "<options>",
|
|
897
|
+
subcommands: {
|
|
898
|
+
testIdAttribute: null,
|
|
899
|
+
exact: { description: "Should locators match the text exactly by default (default: `false`)" }
|
|
900
|
+
},
|
|
901
|
+
transform(val) {
|
|
902
|
+
if (typeof val !== "object" || val == null) return {};
|
|
903
|
+
return val;
|
|
904
|
+
}
|
|
905
|
+
},
|
|
895
906
|
testerHtmlPath: null,
|
|
896
907
|
instances: null,
|
|
897
908
|
expect: null,
|
|
@@ -1243,7 +1254,8 @@ const cliOptionsConfig = {
|
|
|
1243
1254
|
argument: "<path>",
|
|
1244
1255
|
description: "Custom provider for detecting changed files. (default: `git`)",
|
|
1245
1256
|
subcommands: null
|
|
1246
|
-
}
|
|
1257
|
+
},
|
|
1258
|
+
preParse: { description: "Parse test specifications before running them. This will apply `.only` flag and test name pattern across all files without running them. (default: `false`)" }
|
|
1247
1259
|
}
|
|
1248
1260
|
},
|
|
1249
1261
|
cliExclude: null,
|
|
@@ -2324,7 +2336,7 @@ function normalizeCliOptions(cliFilters, argv) {
|
|
|
2324
2336
|
}
|
|
2325
2337
|
async function start(mode, cliFilters, options) {
|
|
2326
2338
|
try {
|
|
2327
|
-
const { startVitest } = await import('./cli-api.
|
|
2339
|
+
const { startVitest } = await import('./cli-api.CaPRsymo.js').then(function (n) { return n.q; });
|
|
2328
2340
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(cliFilters, options));
|
|
2329
2341
|
if (!ctx.shouldKeepServer()) await ctx.exit();
|
|
2330
2342
|
} catch (e) {
|
|
@@ -2346,7 +2358,7 @@ async function init(project) {
|
|
|
2346
2358
|
}
|
|
2347
2359
|
async function collect(mode, cliFilters, options) {
|
|
2348
2360
|
try {
|
|
2349
|
-
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.
|
|
2361
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.CaPRsymo.js').then(function (n) { return n.q; });
|
|
2350
2362
|
const ctx = await prepareVitest(mode, {
|
|
2351
2363
|
...normalizeCliOptions(cliFilters, options),
|
|
2352
2364
|
watch: false,
|
|
@@ -10,16 +10,16 @@ import { parseAst, searchForWorkspaceRoot, fetchModule, version, createServer, i
|
|
|
10
10
|
import { A as API_PATH, c as configFiles, d as defaultBrowserPort, b as defaultPort } from './constants.CPYnjOGj.js';
|
|
11
11
|
import * as nodeos from 'node:os';
|
|
12
12
|
import nodeos__default, { tmpdir } from 'node:os';
|
|
13
|
-
import { generateHash as generateHash$1, createTaskName, validateTags, calculateSuiteHash,
|
|
13
|
+
import { generateHash as generateHash$1, createTaskName, validateTags, calculateSuiteHash, hasFailed, generateFileHash, limitConcurrency, createFileTask as createFileTask$1, createTagsFilter, someTasksAreOnly, interpretTaskModes, 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.Bb7YBzMA.js';
|
|
17
17
|
import { rootDir, distDir } from '../path.js';
|
|
18
|
-
import { f as createIndexLocationsMap, g as TraceMap, o as originalPositionFor, h as ancestor, s as stringify, p as parse, i as printError, j as Typechecker, k as generateCodeFrame, l as escapeRegExp, m as createDefinesScript, a as BenchmarkReportsMap, R as ReportersMap, n as groupBy, q as BlobReporter, r as readBlobs, t as convertTasksToEvents, H as HangingProcessReporter, w as wildcardPatternToRegExp, u as stdout } from './index.
|
|
18
|
+
import { f as createIndexLocationsMap, g as TraceMap, o as originalPositionFor, h as ancestor, s as stringify, p as parse, i as printError, j as Typechecker, k as generateCodeFrame, l as escapeRegExp, m as createDefinesScript, a as BenchmarkReportsMap, R as ReportersMap, n as groupBy, q as BlobReporter, r as readBlobs, t as convertTasksToEvents, H as HangingProcessReporter, w as wildcardPatternToRegExp, u as stdout } from './index.DICur-LY.js';
|
|
19
19
|
import { N as NativeModuleRunner } from './nativeModuleRunner.BIakptoF.js';
|
|
20
20
|
import { T as Traces } from './traces.DT5aQ62U.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.CwUlQe0s.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';
|
|
@@ -389,8 +389,6 @@ function createFileTask(testFilepath, code, requestMap, config, filepath, fileTa
|
|
|
389
389
|
latestSuite.tasks.push(task);
|
|
390
390
|
});
|
|
391
391
|
calculateSuiteHash(file);
|
|
392
|
-
const hasOnly = someTasksAreOnly(file);
|
|
393
|
-
interpretTaskModes(file, config.testNamePattern, void 0, void 0, void 0, hasOnly, false, config.allowOnly);
|
|
394
392
|
markDynamicTests(file.tasks);
|
|
395
393
|
if (!file.tasks.length) file.result = {
|
|
396
394
|
state: "fail",
|
|
@@ -9228,7 +9226,10 @@ function serializeConfig(project) {
|
|
|
9228
9226
|
detailsPanelPosition: browser.detailsPanelPosition ?? "right",
|
|
9229
9227
|
viewport: browser.viewport,
|
|
9230
9228
|
screenshotFailures: browser.screenshotFailures,
|
|
9231
|
-
locators: {
|
|
9229
|
+
locators: {
|
|
9230
|
+
testIdAttribute: browser.locators.testIdAttribute,
|
|
9231
|
+
exact: browser.locators.exact
|
|
9232
|
+
},
|
|
9232
9233
|
providerOptions: provider?.name === "playwright" ? { actionTimeout: provider?.options?.actionTimeout } : {},
|
|
9233
9234
|
trackUnhandledErrors: browser.trackUnhandledErrors ?? true,
|
|
9234
9235
|
trace: browser.trace.mode
|
|
@@ -11221,7 +11222,10 @@ function cloneConfig(project, { browser, ...config }) {
|
|
|
11221
11222
|
...clonedConfig,
|
|
11222
11223
|
browser: {
|
|
11223
11224
|
...project.config.browser,
|
|
11224
|
-
locators: locators ? {
|
|
11225
|
+
locators: locators ? {
|
|
11226
|
+
testIdAttribute: locators.testIdAttribute ?? currentConfig.locators.testIdAttribute,
|
|
11227
|
+
exact: locators.exact ?? currentConfig.locators.exact
|
|
11228
|
+
} : project.config.browser.locators,
|
|
11225
11229
|
viewport: viewport ?? currentConfig.viewport,
|
|
11226
11230
|
testerHtmlPath: testerHtmlPath ?? currentConfig.testerHtmlPath,
|
|
11227
11231
|
screenshotDirectory: screenshotDirectory ?? currentConfig.screenshotDirectory,
|
|
@@ -13413,7 +13417,7 @@ class Vitest {
|
|
|
13413
13417
|
}
|
|
13414
13418
|
this.filenamePattern = filters && filters?.length > 0 ? filters : void 0;
|
|
13415
13419
|
startSpan.setAttribute("vitest.start.filters", this.filenamePattern || []);
|
|
13416
|
-
|
|
13420
|
+
let specifications = await this._traces.$("vitest.config.resolve_include_glob", async () => {
|
|
13417
13421
|
const specifications = await this.specifications.getRelevantTestSpecifications(filters);
|
|
13418
13422
|
startSpan.setAttribute("vitest.start.specifications", specifications.map((s) => {
|
|
13419
13423
|
const relativeModuleId = relative(s.project.config.root, s.moduleId);
|
|
@@ -13422,6 +13426,13 @@ class Vitest {
|
|
|
13422
13426
|
}));
|
|
13423
13427
|
return specifications;
|
|
13424
13428
|
});
|
|
13429
|
+
if (this.config.experimental.preParse) {
|
|
13430
|
+
// This populates specification.testModule with parsed information
|
|
13431
|
+
await this.experimental_parseSpecifications(specifications);
|
|
13432
|
+
specifications = specifications.filter(({ testModule }) => {
|
|
13433
|
+
return !testModule || testModule.task.mode !== "skip";
|
|
13434
|
+
});
|
|
13435
|
+
}
|
|
13425
13436
|
// if run with --changed, don't exit if no tests are found
|
|
13426
13437
|
if (!specifications.length) {
|
|
13427
13438
|
await this._traces.$("vitest.test_run", async () => {
|
|
@@ -13618,14 +13629,34 @@ class Vitest {
|
|
|
13618
13629
|
async experimental_parseSpecifications(specifications, options) {
|
|
13619
13630
|
if (this.mode !== "test") throw new Error(`The \`experimental_parseSpecifications\` does not support "${this.mode}" mode.`);
|
|
13620
13631
|
const limit = limitConcurrency(options?.concurrency ?? (typeof nodeos__default.availableParallelism === "function" ? nodeos__default.availableParallelism() : nodeos__default.cpus().length));
|
|
13621
|
-
|
|
13622
|
-
|
|
13632
|
+
// Phase 1: parse all files in parallel (without mode interpretation)
|
|
13633
|
+
const results = await Promise.all(specifications.map((specification) => limit(async () => {
|
|
13634
|
+
return {
|
|
13635
|
+
file: await astCollectTests(specification.project, specification.moduleId).catch((error) => {
|
|
13636
|
+
return createFailedFileTask(specification.project, specification.moduleId, error);
|
|
13637
|
+
}),
|
|
13638
|
+
specification
|
|
13639
|
+
};
|
|
13640
|
+
})));
|
|
13641
|
+
const tagsFilter = this.config.tagsFilter ? createTagsFilter(this.config.tagsFilter, this.config.tags) : void 0;
|
|
13642
|
+
// Phase 2: cross-file .only resolution
|
|
13643
|
+
const globalHasOnly = results.some(({ file }) => someTasksAreOnly(file));
|
|
13644
|
+
for (const { file, specification } of results) {
|
|
13645
|
+
const config = specification.project.config;
|
|
13646
|
+
interpretTaskModes(file, config.testNamePattern, specification.testLines, specification.testIds, tagsFilter, globalHasOnly, false, config.allowOnly);
|
|
13647
|
+
this.state.collectFiles(specification.project, [file]);
|
|
13648
|
+
}
|
|
13649
|
+
return results.map(({ file }) => this.state.getReportedEntity(file));
|
|
13623
13650
|
}
|
|
13624
13651
|
async experimental_parseSpecification(specification) {
|
|
13625
13652
|
if (this.mode !== "test") throw new Error(`The \`experimental_parseSpecification\` does not support "${this.mode}" mode.`);
|
|
13626
13653
|
const file = await astCollectTests(specification.project, specification.moduleId).catch((error) => {
|
|
13627
13654
|
return createFailedFileTask(specification.project, specification.moduleId, error);
|
|
13628
13655
|
});
|
|
13656
|
+
const config = specification.project.config;
|
|
13657
|
+
const hasOnly = someTasksAreOnly(file);
|
|
13658
|
+
const tagsFilter = this.config.tagsFilter ? createTagsFilter(this.config.tagsFilter, this.config.tags) : void 0;
|
|
13659
|
+
interpretTaskModes(file, config.testNamePattern, specification.testLines, specification.testIds, tagsFilter, hasOnly, false, config.allowOnly);
|
|
13629
13660
|
// register in state, so it can be retrieved by "getReportedEntity"
|
|
13630
13661
|
this.state.collectFiles(specification.project, [file]);
|
|
13631
13662
|
return this.state.getReportedEntity(file);
|
|
@@ -489,6 +489,7 @@ function resolveConfig$1(vitest, options, viteConfig) {
|
|
|
489
489
|
resolved.browser.viewport.height ??= 896;
|
|
490
490
|
resolved.browser.locators ??= {};
|
|
491
491
|
resolved.browser.locators.testIdAttribute ??= "data-testid";
|
|
492
|
+
resolved.browser.locators.exact ??= false;
|
|
492
493
|
if (typeof resolved.browser.provider === "string") {
|
|
493
494
|
const source = `@vitest/browser-${resolved.browser.provider}`;
|
|
494
495
|
throw new TypeError(`The \`browser.provider\` configuration was changed to accept a factory instead of a string. Add an import of "${resolved.browser.provider}" from "${source}" instead. See: https://vitest.dev/config/browser/provider`);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PromisifyAssertion, Tester, ExpectStatic } from '@vitest/expect';
|
|
2
2
|
import { Plugin } from '@vitest/pretty-format';
|
|
3
|
+
import { Test } from '@vitest/runner';
|
|
3
4
|
import { SnapshotState } from '@vitest/snapshot';
|
|
4
5
|
import { B as BenchmarkResult } from './benchmark.d.DAaHLpsq.js';
|
|
5
6
|
import { U as UserConsoleLog } from './rpc.d.BFMWpdph.js';
|
|
@@ -16,6 +17,7 @@ declare module "@vitest/expect" {
|
|
|
16
17
|
interface MatcherState {
|
|
17
18
|
environment: string;
|
|
18
19
|
snapshotState: SnapshotState;
|
|
20
|
+
task?: Readonly<Test>;
|
|
19
21
|
}
|
|
20
22
|
interface ExpectPollOptions {
|
|
21
23
|
interval?: number;
|
|
@@ -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.4L3g53iW.js';
|
|
3
|
+
import './test.BmQO5GaM.js';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import '@vitest/utils/helpers';
|
|
6
6
|
import '@vitest/utils/timers';
|
|
@@ -10,13 +10,13 @@ import './utils.BX5Fg8C4.js';
|
|
|
10
10
|
import '@vitest/expect';
|
|
11
11
|
import '@vitest/utils/error';
|
|
12
12
|
import 'pathe';
|
|
13
|
-
import '@vitest/snapshot';
|
|
14
13
|
import '@vitest/spy';
|
|
15
14
|
import '@vitest/utils/offset';
|
|
16
15
|
import '@vitest/utils/source-map';
|
|
17
16
|
import './_commonjsHelpers.D26ty3Ew.js';
|
|
18
17
|
import './rpc.MzXet3jl.js';
|
|
19
18
|
import './index.Chj8NDwU.js';
|
|
19
|
+
import '@vitest/snapshot';
|
|
20
20
|
import './evaluatedModules.Dg1zASAC.js';
|
|
21
21
|
import 'vite/module-runner';
|
|
22
22
|
import 'expect-type';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as vi, N as NodeBenchmarkRunner, T as TestRunner, a as assert, c as createExpect, g as globalExpect, i as inject, s as should, b as vitest } from './test.
|
|
1
|
+
import { v as vi, N as NodeBenchmarkRunner, S as Snapshots, T as TestRunner, a as assert, c as createExpect, g as globalExpect, i as inject, s as should, b as vitest } from './test.BmQO5GaM.js';
|
|
2
2
|
import { b as bench } from './benchmark.CX_oY03V.js';
|
|
3
3
|
import { V as VitestEvaluatedModules } from './evaluatedModules.Dg1zASAC.js';
|
|
4
4
|
import { expectTypeOf } from 'expect-type';
|
|
@@ -11,6 +11,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
11
11
|
__proto__: null,
|
|
12
12
|
BenchmarkRunner: NodeBenchmarkRunner,
|
|
13
13
|
EvaluatedModules: VitestEvaluatedModules,
|
|
14
|
+
Snapshots: Snapshots,
|
|
14
15
|
TestRunner: TestRunner,
|
|
15
16
|
afterAll: afterAll,
|
|
16
17
|
afterEach: afterEach,
|
|
@@ -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.NdrZGMhw.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.BmQO5GaM.js';
|
|
7
7
|
|
|
8
8
|
function setupChaiConfig(config) {
|
|
9
9
|
Object.assign(chai.config, config);
|
|
@@ -1836,6 +1836,7 @@ const skipErrorProperties = new Set([
|
|
|
1836
1836
|
"VITEST_TEST_NAME",
|
|
1837
1837
|
"VITEST_TEST_PATH",
|
|
1838
1838
|
"__vitest_rollup_error__",
|
|
1839
|
+
"__vitest_error_context__",
|
|
1839
1840
|
...Object.getOwnPropertyNames(Error.prototype),
|
|
1840
1841
|
...Object.getOwnPropertyNames(Object.prototype)
|
|
1841
1842
|
]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DevEnvironment } from 'vite';
|
|
2
|
-
import { V as Vitest, T as TestProject, a as TestProjectConfiguration } from './reporters.d.
|
|
2
|
+
import { V as Vitest, T as TestProject, a as TestProjectConfiguration } from './reporters.d.yJ2fBir5.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Generate a unique cache identifier.
|
|
@@ -3,14 +3,14 @@ import { TestError, SerializedError, Arrayable, ParsedStack, Awaitable } from '@
|
|
|
3
3
|
import { A as AfterSuiteRunMeta, U as UserConsoleLog, b as AsyncLeak, P as ProvidedContext, L as LabelColor } from './rpc.d.BFMWpdph.js';
|
|
4
4
|
import { Writable } from 'node:stream';
|
|
5
5
|
import { DevEnvironment, TransformResult as TransformResult$1, ViteDevServer, Plugin, UserConfig as UserConfig$1, DepOptimizationConfig, ServerOptions, ConfigEnv, AliasOptions } from 'vite';
|
|
6
|
-
import { S as SerializedTestSpecification, c as SourceModuleDiagnostic, B as BrowserTesterOptions } from './browser.d.
|
|
7
|
-
import { B as BrowserTraceViewMode, S as SerializedConfig, F as FakeTimerInstallOpts } from './config.d.
|
|
6
|
+
import { S as SerializedTestSpecification, c as SourceModuleDiagnostic, B as BrowserTesterOptions } from './browser.d.C0zGu1u9.js';
|
|
7
|
+
import { B as BrowserTraceViewMode, S as SerializedConfig, F as FakeTimerInstallOpts } from './config.d.ChUh6-ad.js';
|
|
8
8
|
import { PrettyFormatOptions } from '@vitest/pretty-format';
|
|
9
9
|
import { SnapshotSummary, SnapshotStateOptions } from '@vitest/snapshot';
|
|
10
10
|
import { SerializedDiffOptions } from '@vitest/utils/diff';
|
|
11
11
|
import { chai } from '@vitest/expect';
|
|
12
12
|
import { happyDomTypes, jsdomTypes } from 'vitest/optional-types.js';
|
|
13
|
-
import { c as ContextTestEnvironment, d as WorkerExecuteContext, e as WorkerTestEnvironment } from './worker.d.
|
|
13
|
+
import { c as ContextTestEnvironment, d as WorkerExecuteContext, e as WorkerTestEnvironment } from './worker.d.CckNUvI5.js';
|
|
14
14
|
import { O as OTELCarrier } from './traces.d.402V_yFI.js';
|
|
15
15
|
import { B as BenchmarkResult } from './benchmark.d.DAaHLpsq.js';
|
|
16
16
|
import { MockedModule } from '@vitest/mocker';
|
|
@@ -1609,6 +1609,11 @@ interface BrowserConfigOptions {
|
|
|
1609
1609
|
* @default 'data-testid'
|
|
1610
1610
|
*/
|
|
1611
1611
|
testIdAttribute?: string;
|
|
1612
|
+
/**
|
|
1613
|
+
* Should locators match the text exactly by default
|
|
1614
|
+
* @default false
|
|
1615
|
+
*/
|
|
1616
|
+
exact?: boolean;
|
|
1612
1617
|
};
|
|
1613
1618
|
/**
|
|
1614
1619
|
* Generate traces that can be viewed on https://trace.playwright.dev/
|
|
@@ -1772,6 +1777,7 @@ interface ResolvedBrowserOptions extends BrowserConfigOptions {
|
|
|
1772
1777
|
screenshotFailures: boolean;
|
|
1773
1778
|
locators: {
|
|
1774
1779
|
testIdAttribute: string;
|
|
1780
|
+
exact: boolean;
|
|
1775
1781
|
};
|
|
1776
1782
|
trace: {
|
|
1777
1783
|
mode: BrowserTraceViewMode;
|
|
@@ -3280,6 +3286,11 @@ interface InlineConfig {
|
|
|
3280
3286
|
* implementation of the `VCSProvider` interface to use a different version control system.
|
|
3281
3287
|
*/
|
|
3282
3288
|
vcsProvider?: VCSProvider | string;
|
|
3289
|
+
/**
|
|
3290
|
+
* Parse test specifications before running them.
|
|
3291
|
+
* This will apply `.only` flag and test name pattern across all files without running them.
|
|
3292
|
+
*/
|
|
3293
|
+
preParse?: boolean;
|
|
3283
3294
|
};
|
|
3284
3295
|
/**
|
|
3285
3296
|
* Define tags available in your test files.
|
|
@@ -26,7 +26,7 @@ async function setupCommonEnv(config) {
|
|
|
26
26
|
if (globalSetup) return;
|
|
27
27
|
globalSetup = true;
|
|
28
28
|
setSafeTimers();
|
|
29
|
-
if (config.globals) (await import('./globals.
|
|
29
|
+
if (config.globals) (await import('./globals.7B-4LHAF.js')).registerApiGlobally();
|
|
30
30
|
}
|
|
31
31
|
function setupDefines(config) {
|
|
32
32
|
for (const key in config.defines) globalThis[key] = config.defines[key];
|