@vitest/runner 4.0.16 → 4.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-tasks.js +9 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +63 -4
- package/dist/{tasks.d-BUa1HjoW.d.ts → tasks.d-hZ73xajr.d.ts} +64 -14
- package/dist/types.d.ts +6 -4
- package/dist/utils.d.ts +3 -3
- package/package.json +2 -2
package/dist/chunk-tasks.js
CHANGED
|
@@ -34,13 +34,16 @@ function createChainable(keys, fn) {
|
|
|
34
34
|
/**
|
|
35
35
|
* If any tasks been marked as `only`, mark all other tasks as `skip`.
|
|
36
36
|
*/
|
|
37
|
-
function interpretTaskModes(file, namePattern, testLocations, onlyMode, parentIsOnly, allowOnly) {
|
|
37
|
+
function interpretTaskModes(file, namePattern, testLocations, testIds, onlyMode, parentIsOnly, allowOnly) {
|
|
38
38
|
const matchedLocations = [];
|
|
39
39
|
const traverseSuite = (suite, parentIsOnly, parentMatchedWithLocation) => {
|
|
40
40
|
const suiteIsOnly = parentIsOnly || suite.mode === "only";
|
|
41
|
+
// Check if any tasks in this suite have `.only` - if so, only those should run
|
|
42
|
+
const hasSomeTasksOnly = onlyMode && suite.tasks.some((t) => t.mode === "only" || t.type === "suite" && someTasksAreOnly(t));
|
|
41
43
|
suite.tasks.forEach((t) => {
|
|
42
44
|
// Check if either the parent suite or the task itself are marked as included
|
|
43
|
-
|
|
45
|
+
// If there are tasks with `.only` in this suite, only include those (not all tasks from describe.only)
|
|
46
|
+
const includeTask = hasSomeTasksOnly ? t.mode === "only" || t.type === "suite" && someTasksAreOnly(t) : suiteIsOnly || t.mode === "only";
|
|
44
47
|
if (onlyMode) {
|
|
45
48
|
if (t.type === "suite" && (includeTask || someTasksAreOnly(t))) {
|
|
46
49
|
// Don't skip this suite
|
|
@@ -57,7 +60,7 @@ function interpretTaskModes(file, namePattern, testLocations, onlyMode, parentIs
|
|
|
57
60
|
}
|
|
58
61
|
let hasLocationMatch = parentMatchedWithLocation;
|
|
59
62
|
// Match test location against provided locations, only run if present
|
|
60
|
-
// in `testLocations`. Note: if `
|
|
63
|
+
// in `testLocations`. Note: if `includeTaskLocation` is not enabled,
|
|
61
64
|
// all test will be skipped.
|
|
62
65
|
if (testLocations !== undefined && testLocations.length !== 0) {
|
|
63
66
|
if (t.location && (testLocations === null || testLocations === void 0 ? void 0 : testLocations.includes(t.location.line))) {
|
|
@@ -74,6 +77,9 @@ function interpretTaskModes(file, namePattern, testLocations, onlyMode, parentIs
|
|
|
74
77
|
if (namePattern && !getTaskFullName(t).match(namePattern)) {
|
|
75
78
|
t.mode = "skip";
|
|
76
79
|
}
|
|
80
|
+
if (testIds && !testIds.includes(t.id)) {
|
|
81
|
+
t.mode = "skip";
|
|
82
|
+
}
|
|
77
83
|
} else if (t.type === "suite") {
|
|
78
84
|
if (t.mode === "skip") {
|
|
79
85
|
skipAllTasks(t);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as TestArtifact, a as Test, S as Suite, d as SuiteHooks, F as File, e as TaskUpdateEvent, T as Task, f as TestAPI, g as SuiteAPI, h as SuiteCollector } from './tasks.d-
|
|
2
|
-
export { A as AfterAllListener, n as AfterEachListener, B as BeforeAllListener, p as BeforeEachListener, q as Fixture, r as FixtureFn, s as FixtureOptions, t as Fixtures, I as ImportDuration, u as InferFixturesTypes, O as OnTestFailedHandler, v as OnTestFinishedHandler, R as
|
|
1
|
+
import { b as TestArtifact, a as Test, S as Suite, d as SuiteHooks, F as File, e as TaskUpdateEvent, T as Task, f as TestAPI, g as SuiteAPI, h as SuiteCollector } from './tasks.d-hZ73xajr.js';
|
|
2
|
+
export { A as AfterAllListener, n as AfterEachListener, B as BeforeAllListener, p as BeforeEachListener, q as Fixture, r as FixtureFn, s as FixtureOptions, t as Fixtures, I as ImportDuration, u as InferFixturesTypes, O as OnTestFailedHandler, v as OnTestFinishedHandler, R as Retry, w as RunMode, x as RuntimeContext, y as SequenceHooks, z as SequenceSetupFiles, D as SerializableRetry, E as SuiteFactory, G as TaskBase, H as TaskCustomOptions, J as TaskEventPack, K as TaskHook, L as TaskMeta, M as TaskPopulated, N as TaskResult, P as TaskResultPack, Q as TaskState, U as TestAnnotation, V as TestAnnotationArtifact, W as TestAnnotationLocation, X as TestArtifactBase, Y as TestArtifactLocation, Z as TestArtifactRegistry, _ as TestAttachment, $ as TestContext, a0 as TestFunction, a1 as TestOptions, a2 as Use, a3 as VisualRegressionArtifact, i as afterAll, j as afterEach, k as beforeAll, l as beforeEach, o as onTestFailed, m as onTestFinished } from './tasks.d-hZ73xajr.js';
|
|
3
3
|
import { Awaitable } from '@vitest/utils';
|
|
4
4
|
import { FileSpecification, VitestRunner } from './types.js';
|
|
5
5
|
export { CancelReason, VitestRunnerConfig, VitestRunnerConstructor, VitestRunnerImportSource } from './types.js';
|
package/dist/index.js
CHANGED
|
@@ -680,7 +680,7 @@ let defaultSuite;
|
|
|
680
680
|
let currentTestFilepath;
|
|
681
681
|
function assert(condition, message) {
|
|
682
682
|
if (!condition) {
|
|
683
|
-
throw new Error(`Vitest failed to find ${message}.
|
|
683
|
+
throw new Error(`Vitest failed to find ${message}. One of the following is possible:` + "\n- \"vitest\" is imported directly without running \"vitest\" command" + "\n- \"vitest\" is imported inside \"globalSetup\" (to fix this, use \"setupFiles\" instead, because \"globalSetup\" runs in a different context)" + "\n- \"vitest\" is imported inside Vite / Vitest config file" + "\n- Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues\n");
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
function getDefaultSuite() {
|
|
@@ -1365,6 +1365,8 @@ async function collectTests(specs, runner) {
|
|
|
1365
1365
|
await $("collect_spec", { "code.file.path": filepath }, async () => {
|
|
1366
1366
|
var _runner$onCollectStar;
|
|
1367
1367
|
const testLocations = typeof spec === "string" ? undefined : spec.testLocations;
|
|
1368
|
+
const testNamePattern = typeof spec === "string" ? undefined : spec.testNamePattern;
|
|
1369
|
+
const testIds = typeof spec === "string" ? undefined : spec.testIds;
|
|
1368
1370
|
const file = createFileTask(filepath, config.root, config.name, runner.pool, runner.viteEnvironment);
|
|
1369
1371
|
setFileContext(file, Object.create(null));
|
|
1370
1372
|
file.shuffle = config.sequence.shuffle;
|
|
@@ -1420,7 +1422,7 @@ async function collectTests(specs, runner) {
|
|
|
1420
1422
|
}
|
|
1421
1423
|
calculateSuiteHash(file);
|
|
1422
1424
|
const hasOnlyTasks = someTasksAreOnly(file);
|
|
1423
|
-
interpretTaskModes(file, config.testNamePattern, testLocations, hasOnlyTasks, false, config.allowOnly);
|
|
1425
|
+
interpretTaskModes(file, testNamePattern ?? config.testNamePattern, testLocations, testIds, hasOnlyTasks, false, config.allowOnly);
|
|
1424
1426
|
if (file.mode === "queued") {
|
|
1425
1427
|
file.mode = "run";
|
|
1426
1428
|
}
|
|
@@ -1440,6 +1442,37 @@ function mergeHooks(baseHooks, hooks) {
|
|
|
1440
1442
|
const now = globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
1441
1443
|
const unixNow = Date.now;
|
|
1442
1444
|
const { clearTimeout, setTimeout } = getSafeTimers();
|
|
1445
|
+
/**
|
|
1446
|
+
* Normalizes retry configuration to extract individual values.
|
|
1447
|
+
* Handles both number and object forms.
|
|
1448
|
+
*/
|
|
1449
|
+
function getRetryCount(retry) {
|
|
1450
|
+
if (retry === undefined) {
|
|
1451
|
+
return 0;
|
|
1452
|
+
}
|
|
1453
|
+
if (typeof retry === "number") {
|
|
1454
|
+
return retry;
|
|
1455
|
+
}
|
|
1456
|
+
return retry.count ?? 0;
|
|
1457
|
+
}
|
|
1458
|
+
function getRetryDelay(retry) {
|
|
1459
|
+
if (retry === undefined) {
|
|
1460
|
+
return 0;
|
|
1461
|
+
}
|
|
1462
|
+
if (typeof retry === "number") {
|
|
1463
|
+
return 0;
|
|
1464
|
+
}
|
|
1465
|
+
return retry.delay ?? 0;
|
|
1466
|
+
}
|
|
1467
|
+
function getRetryCondition(retry) {
|
|
1468
|
+
if (retry === undefined) {
|
|
1469
|
+
return undefined;
|
|
1470
|
+
}
|
|
1471
|
+
if (typeof retry === "number") {
|
|
1472
|
+
return undefined;
|
|
1473
|
+
}
|
|
1474
|
+
return retry.condition;
|
|
1475
|
+
}
|
|
1443
1476
|
function updateSuiteHookState(task, name, state, runner) {
|
|
1444
1477
|
if (!task.result) {
|
|
1445
1478
|
task.result = { state: "run" };
|
|
@@ -1603,6 +1636,25 @@ async function callCleanupHooks(runner, cleanups) {
|
|
|
1603
1636
|
}
|
|
1604
1637
|
}
|
|
1605
1638
|
}
|
|
1639
|
+
/**
|
|
1640
|
+
* Determines if a test should be retried based on its retryCondition configuration
|
|
1641
|
+
*/
|
|
1642
|
+
function passesRetryCondition(test, errors) {
|
|
1643
|
+
const condition = getRetryCondition(test.retry);
|
|
1644
|
+
if (!errors || errors.length === 0) {
|
|
1645
|
+
return false;
|
|
1646
|
+
}
|
|
1647
|
+
if (!condition) {
|
|
1648
|
+
return true;
|
|
1649
|
+
}
|
|
1650
|
+
const error = errors[errors.length - 1];
|
|
1651
|
+
if (condition instanceof RegExp) {
|
|
1652
|
+
return condition.test(error.message || "");
|
|
1653
|
+
} else if (typeof condition === "function") {
|
|
1654
|
+
return condition(error);
|
|
1655
|
+
}
|
|
1656
|
+
return false;
|
|
1657
|
+
}
|
|
1606
1658
|
async function runTest(test, runner) {
|
|
1607
1659
|
var _runner$onBeforeRunTa, _test$result, _runner$onAfterRunTas;
|
|
1608
1660
|
await ((_runner$onBeforeRunTa = runner.onBeforeRunTask) === null || _runner$onBeforeRunTa === void 0 ? void 0 : _runner$onBeforeRunTa.call(runner, test));
|
|
@@ -1631,7 +1683,7 @@ async function runTest(test, runner) {
|
|
|
1631
1683
|
const $ = runner.trace;
|
|
1632
1684
|
const repeats = test.repeats ?? 0;
|
|
1633
1685
|
for (let repeatCount = 0; repeatCount <= repeats; repeatCount++) {
|
|
1634
|
-
const retry = test.retry
|
|
1686
|
+
const retry = getRetryCount(test.retry);
|
|
1635
1687
|
for (let retryCount = 0; retryCount <= retry; retryCount++) {
|
|
1636
1688
|
var _test$onFinished, _test$onFailed, _runner$onAfterRetryT, _test$result2, _test$result3;
|
|
1637
1689
|
let beforeEachCleanups = [];
|
|
@@ -1712,9 +1764,16 @@ async function runTest(test, runner) {
|
|
|
1712
1764
|
break;
|
|
1713
1765
|
}
|
|
1714
1766
|
if (retryCount < retry) {
|
|
1715
|
-
|
|
1767
|
+
const shouldRetry = passesRetryCondition(test, test.result.errors);
|
|
1768
|
+
if (!shouldRetry) {
|
|
1769
|
+
break;
|
|
1770
|
+
}
|
|
1716
1771
|
test.result.state = "run";
|
|
1717
1772
|
test.result.retryCount = (test.result.retryCount ?? 0) + 1;
|
|
1773
|
+
const delay = getRetryDelay(test.retry);
|
|
1774
|
+
if (delay > 0) {
|
|
1775
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
1776
|
+
}
|
|
1718
1777
|
}
|
|
1719
1778
|
// update retry info
|
|
1720
1779
|
updateTask("test-retried", test, runner);
|
|
@@ -226,10 +226,12 @@ interface TaskBase {
|
|
|
226
226
|
*/
|
|
227
227
|
result?: TaskResult;
|
|
228
228
|
/**
|
|
229
|
-
*
|
|
229
|
+
* Retry configuration for the task.
|
|
230
|
+
* - If a number, specifies how many times to retry
|
|
231
|
+
* - If an object, allows fine-grained retry control
|
|
230
232
|
* @default 0
|
|
231
233
|
*/
|
|
232
|
-
retry?:
|
|
234
|
+
retry?: Retry;
|
|
233
235
|
/**
|
|
234
236
|
* The amount of times the task should be repeated after the successful run.
|
|
235
237
|
* If the task fails, it will not be retried unless `retry` is specified.
|
|
@@ -448,18 +450,68 @@ type ChainableTestAPI<ExtraContext = object> = ChainableFunction<"concurrent" |
|
|
|
448
450
|
for: TestForFunction<ExtraContext>;
|
|
449
451
|
}>;
|
|
450
452
|
type TestCollectorOptions = Omit<TestOptions, "shuffle">;
|
|
453
|
+
/**
|
|
454
|
+
* Retry configuration for tests.
|
|
455
|
+
* Can be a number for simple retry count, or an object for advanced retry control.
|
|
456
|
+
*/
|
|
457
|
+
type Retry = number | {
|
|
458
|
+
/**
|
|
459
|
+
* The number of times to retry the test if it fails.
|
|
460
|
+
* @default 0
|
|
461
|
+
*/
|
|
462
|
+
count?: number;
|
|
463
|
+
/**
|
|
464
|
+
* Delay in milliseconds between retry attempts.
|
|
465
|
+
* @default 0
|
|
466
|
+
*/
|
|
467
|
+
delay?: number;
|
|
468
|
+
/**
|
|
469
|
+
* Condition to determine if a test should be retried based on the error.
|
|
470
|
+
* - If a RegExp, it is tested against the error message
|
|
471
|
+
* - If a function, called with the TestError object; return true to retry
|
|
472
|
+
*
|
|
473
|
+
* NOTE: Functions can only be used in test files, not in vitest.config.ts,
|
|
474
|
+
* because the configuration is serialized when passed to worker threads.
|
|
475
|
+
*
|
|
476
|
+
* @default undefined (retry on all errors)
|
|
477
|
+
*/
|
|
478
|
+
condition?: RegExp | ((error: TestError) => boolean);
|
|
479
|
+
};
|
|
480
|
+
/**
|
|
481
|
+
* Serializable retry configuration (used in config files).
|
|
482
|
+
* Functions cannot be serialized, so only string conditions are allowed.
|
|
483
|
+
*/
|
|
484
|
+
type SerializableRetry = number | {
|
|
485
|
+
/**
|
|
486
|
+
* The number of times to retry the test if it fails.
|
|
487
|
+
* @default 0
|
|
488
|
+
*/
|
|
489
|
+
count?: number;
|
|
490
|
+
/**
|
|
491
|
+
* Delay in milliseconds between retry attempts.
|
|
492
|
+
* @default 0
|
|
493
|
+
*/
|
|
494
|
+
delay?: number;
|
|
495
|
+
/**
|
|
496
|
+
* Condition to determine if a test should be retried based on the error.
|
|
497
|
+
* Must be a RegExp tested against the error message.
|
|
498
|
+
*
|
|
499
|
+
* @default undefined (retry on all errors)
|
|
500
|
+
*/
|
|
501
|
+
condition?: RegExp;
|
|
502
|
+
};
|
|
451
503
|
interface TestOptions {
|
|
452
504
|
/**
|
|
453
505
|
* Test timeout.
|
|
454
506
|
*/
|
|
455
507
|
timeout?: number;
|
|
456
508
|
/**
|
|
457
|
-
*
|
|
458
|
-
*
|
|
459
|
-
*
|
|
509
|
+
* Retry configuration for the test.
|
|
510
|
+
* - If a number, specifies how many times to retry
|
|
511
|
+
* - If an object, allows fine-grained retry control
|
|
460
512
|
* @default 0
|
|
461
513
|
*/
|
|
462
|
-
retry?:
|
|
514
|
+
retry?: Retry;
|
|
463
515
|
/**
|
|
464
516
|
* How many times the test will run again.
|
|
465
517
|
* Only inner tests will repeat if set on `describe()`, nested `describe()` will inherit parent's repeat by default.
|
|
@@ -510,7 +562,7 @@ interface Hooks<ExtraContext> {
|
|
|
510
562
|
}
|
|
511
563
|
type TestAPI<ExtraContext = object> = ChainableTestAPI<ExtraContext> & ExtendedAPI<ExtraContext> & Hooks<ExtraContext> & {
|
|
512
564
|
extend: <T extends Record<string, any> = object>(fixtures: Fixtures<T, ExtraContext>) => TestAPI<{ [K in keyof T | keyof ExtraContext] : K extends keyof T ? T[K] : K extends keyof ExtraContext ? ExtraContext[K] : never }>;
|
|
513
|
-
scoped: (fixtures: Fixtures<
|
|
565
|
+
scoped: (fixtures: Partial<Fixtures<ExtraContext>>) => void;
|
|
514
566
|
};
|
|
515
567
|
interface FixtureOptions {
|
|
516
568
|
/**
|
|
@@ -545,7 +597,7 @@ type Fixture<
|
|
|
545
597
|
ExtraContext = object
|
|
546
598
|
> = ((...args: any) => any) extends T[K] ? T[K] extends any ? FixtureFn<T, K, Omit<ExtraContext, Exclude<keyof T, K>>> : never : T[K] | (T[K] extends any ? FixtureFn<T, K, Omit<ExtraContext, Exclude<keyof T, K>>> : never);
|
|
547
599
|
type Fixtures<
|
|
548
|
-
T
|
|
600
|
+
T,
|
|
549
601
|
ExtraContext = object
|
|
550
602
|
> = { [K in keyof T] : Fixture<T, K, ExtraContext & TestContext> | [Fixture<T, K, ExtraContext & TestContext>, FixtureOptions?] };
|
|
551
603
|
type InferFixturesTypes<T> = T extends TestAPI<infer C> ? C : T;
|
|
@@ -732,13 +784,11 @@ interface TestAnnotationArtifact extends TestArtifactBase {
|
|
|
732
784
|
type: "internal:annotation";
|
|
733
785
|
annotation: TestAnnotation;
|
|
734
786
|
}
|
|
735
|
-
|
|
736
|
-
name: "reference" | "actual";
|
|
787
|
+
interface VisualRegressionArtifactAttachment extends TestAttachment {
|
|
788
|
+
name: "reference" | "actual" | "diff";
|
|
737
789
|
width: number;
|
|
738
790
|
height: number;
|
|
739
|
-
}
|
|
740
|
-
name: "diff";
|
|
741
|
-
});
|
|
791
|
+
}
|
|
742
792
|
/**
|
|
743
793
|
* @experimental
|
|
744
794
|
*
|
|
@@ -833,4 +883,4 @@ interface TestArtifactRegistry {}
|
|
|
833
883
|
type TestArtifact = TestAnnotationArtifact | VisualRegressionArtifact | TestArtifactRegistry[keyof TestArtifactRegistry];
|
|
834
884
|
|
|
835
885
|
export { createChainable as c, afterAll as i, afterEach as j, beforeAll as k, beforeEach as l, onTestFinished as m, onTestFailed as o };
|
|
836
|
-
export type {
|
|
886
|
+
export type { TestContext as $, AfterAllListener as A, BeforeAllListener as B, ChainableFunction as C, SerializableRetry as D, SuiteFactory as E, File as F, TaskBase as G, TaskCustomOptions as H, ImportDuration as I, TaskEventPack as J, TaskHook as K, TaskMeta as L, TaskPopulated as M, TaskResult as N, OnTestFailedHandler as O, TaskResultPack as P, TaskState as Q, Retry as R, Suite as S, Task as T, TestAnnotation as U, TestAnnotationArtifact as V, TestAnnotationLocation as W, TestArtifactBase as X, TestArtifactLocation as Y, TestArtifactRegistry as Z, TestAttachment as _, Test as a, TestFunction as a0, TestOptions as a1, Use as a2, VisualRegressionArtifact as a3, TestArtifact as b, SuiteHooks as d, TaskUpdateEvent as e, TestAPI as f, SuiteAPI as g, SuiteCollector as h, AfterEachListener as n, BeforeEachListener as p, Fixture as q, FixtureFn as r, FixtureOptions as s, Fixtures as t, InferFixturesTypes as u, OnTestFinishedHandler as v, RunMode as w, RuntimeContext as x, SequenceHooks as y, SequenceSetupFiles as z };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DiffOptions } from '@vitest/utils/diff';
|
|
2
|
-
import { F as File, a as Test, S as Suite,
|
|
3
|
-
export { A as AfterAllListener, n as AfterEachListener, B as BeforeAllListener, p as BeforeEachListener, q as Fixture, r as FixtureFn, s as FixtureOptions, t as Fixtures, u as InferFixturesTypes, O as OnTestFailedHandler, v as OnTestFinishedHandler, R as
|
|
2
|
+
import { F as File, a as Test, S as Suite, P as TaskResultPack, J as TaskEventPack, U as TestAnnotation, b as TestArtifact, $ as TestContext, I as ImportDuration, y as SequenceHooks, z as SequenceSetupFiles, D as SerializableRetry } from './tasks.d-hZ73xajr.js';
|
|
3
|
+
export { A as AfterAllListener, n as AfterEachListener, B as BeforeAllListener, p as BeforeEachListener, q as Fixture, r as FixtureFn, s as FixtureOptions, t as Fixtures, u as InferFixturesTypes, O as OnTestFailedHandler, v as OnTestFinishedHandler, R as Retry, w as RunMode, x as RuntimeContext, g as SuiteAPI, h as SuiteCollector, E as SuiteFactory, d as SuiteHooks, T as Task, G as TaskBase, H as TaskCustomOptions, K as TaskHook, L as TaskMeta, M as TaskPopulated, N as TaskResult, Q as TaskState, e as TaskUpdateEvent, f as TestAPI, V as TestAnnotationArtifact, W as TestAnnotationLocation, X as TestArtifactBase, Y as TestArtifactLocation, Z as TestArtifactRegistry, _ as TestAttachment, a0 as TestFunction, a1 as TestOptions, a2 as Use, a3 as VisualRegressionArtifact } from './tasks.d-hZ73xajr.js';
|
|
4
4
|
import '@vitest/utils';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -26,7 +26,7 @@ interface VitestRunnerConfig {
|
|
|
26
26
|
maxConcurrency: number;
|
|
27
27
|
testTimeout: number;
|
|
28
28
|
hookTimeout: number;
|
|
29
|
-
retry:
|
|
29
|
+
retry: SerializableRetry;
|
|
30
30
|
includeTaskLocation?: boolean;
|
|
31
31
|
diffOptions?: DiffOptions;
|
|
32
32
|
}
|
|
@@ -36,6 +36,8 @@ interface VitestRunnerConfig {
|
|
|
36
36
|
interface FileSpecification {
|
|
37
37
|
filepath: string;
|
|
38
38
|
testLocations: number[] | undefined;
|
|
39
|
+
testNamePattern: RegExp | undefined;
|
|
40
|
+
testIds: string[] | undefined;
|
|
39
41
|
}
|
|
40
42
|
type VitestRunnerImportSource = "collect" | "setup";
|
|
41
43
|
interface VitestRunnerConstructor {
|
|
@@ -179,5 +181,5 @@ interface VitestRunner {
|
|
|
179
181
|
_currentTaskTimeout?: number;
|
|
180
182
|
}
|
|
181
183
|
|
|
182
|
-
export { File, ImportDuration, SequenceHooks, SequenceSetupFiles, Suite, TaskEventPack, TaskResultPack, Test, TestAnnotation, TestArtifact, TestContext };
|
|
184
|
+
export { File, ImportDuration, SequenceHooks, SequenceSetupFiles, SerializableRetry, Suite, TaskEventPack, TaskResultPack, Test, TestAnnotation, TestArtifact, TestContext };
|
|
183
185
|
export type { CancelReason, FileSpecification, VitestRunner, VitestRunnerConfig, VitestRunnerConstructor, VitestRunnerImportSource };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { S as Suite, F as File, T as Task, a as Test } from './tasks.d-
|
|
2
|
-
export { C as ChainableFunction, c as createChainable } from './tasks.d-
|
|
1
|
+
import { S as Suite, F as File, T as Task, a as Test } from './tasks.d-hZ73xajr.js';
|
|
2
|
+
export { C as ChainableFunction, c as createChainable } from './tasks.d-hZ73xajr.js';
|
|
3
3
|
import { ParsedStack, Arrayable } from '@vitest/utils';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* If any tasks been marked as `only`, mark all other tasks as `skip`.
|
|
7
7
|
*/
|
|
8
|
-
declare function interpretTaskModes(file: Suite, namePattern?: string | RegExp, testLocations?: number[] | undefined, onlyMode?: boolean, parentIsOnly?: boolean, allowOnly?: boolean): void;
|
|
8
|
+
declare function interpretTaskModes(file: Suite, namePattern?: string | RegExp, testLocations?: number[] | undefined, testIds?: string[] | undefined, onlyMode?: boolean, parentIsOnly?: boolean, allowOnly?: boolean): void;
|
|
9
9
|
declare function someTasksAreOnly(suite: Suite): boolean;
|
|
10
10
|
declare function generateHash(str: string): string;
|
|
11
11
|
declare function calculateSuiteHash(parent: Suite): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest/runner",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.1.0-beta.1",
|
|
5
5
|
"description": "Vitest test runner",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://opencollective.com/vitest",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"pathe": "^2.0.3",
|
|
42
|
-
"@vitest/utils": "4.0.
|
|
42
|
+
"@vitest/utils": "4.1.0-beta.1"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "premove dist && rollup -c",
|