@vitest/runner 4.1.0 → 4.1.2

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.
@@ -37,10 +37,10 @@ interface VitestRunnerConfig {
37
37
  interface FileSpecification {
38
38
  filepath: string;
39
39
  fileTags?: string[];
40
- testLocations: number[] | undefined;
41
- testNamePattern: RegExp | undefined;
42
- testTagsFilter: string[] | undefined;
43
- testIds: string[] | undefined;
40
+ testLocations?: number[] | undefined;
41
+ testNamePattern?: RegExp | undefined;
42
+ testTagsFilter?: string[] | undefined;
43
+ testIds?: string[] | undefined;
44
44
  }
45
45
  interface TestTagDefinition extends Omit<TestOptions, "tags" | "shuffle"> {
46
46
  /**
@@ -190,10 +190,6 @@ interface VitestRunner {
190
190
  onCleanupWorkerContext?: (cleanup: () => unknown) => void;
191
191
  trace?<T>(name: string, cb: () => T): T;
192
192
  trace?<T>(name: string, attributes: Record<string, any>, cb: () => T): T;
193
- /** @private */
194
- _currentTaskStartTime?: number;
195
- /** @private */
196
- _currentTaskTimeout?: number;
197
193
  }
198
194
 
199
195
  interface TestFixtureItem extends FixtureOptions {
@@ -217,6 +213,7 @@ declare class TestFixtures {
217
213
  static clearDefinitions(): void;
218
214
  static getWorkerContexts(): Record<string, any>[];
219
215
  static getFileContexts(file: File): Record<string, any>[];
216
+ static isFixtureOptions(obj: unknown): boolean;
220
217
  constructor(registrations?: FixtureRegistrations);
221
218
  extend(runner: VitestRunner, userFixtures: UserFixtures): TestFixtures;
222
219
  get(suite: Suite): FixtureRegistrations;
@@ -1330,7 +1327,7 @@ interface TestAttachment {
1330
1327
  /** File system path to the attachment */
1331
1328
  path?: string;
1332
1329
  /** Inline attachment content as a string or raw binary data */
1333
- body?: string | Uint8Array;
1330
+ body?: string | Uint8Array | undefined;
1334
1331
  }
1335
1332
  interface Location {
1336
1333
  /** Line number in the source file (1-indexed) */
package/dist/types.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { A as AfterAllListener, i as AfterEachListener, j as AroundAllListener, k as AroundEachListener, B as BeforeAllListener, l as BeforeEachListener, C as CancelReason, m as FailureScreenshotArtifact, c as File, F as FileSpecification, n as Fixture, o as FixtureFn, p as FixtureOptions, q as Fixtures, I as ImportDuration, r as InferFixturesTypes, O as OnTestFailedHandler, s as OnTestFinishedHandler, R as Retry, t as RunMode, u as RuntimeContext, v as SequenceHooks, w as SequenceSetupFiles, x as SerializableRetry, S as Suite, g as SuiteAPI, h as SuiteCollector, y as SuiteFactory, b as SuiteHooks, z as SuiteOptions, e as Task, D as TaskBase, E as TaskCustomOptions, G as TaskEventPack, H as TaskHook, J as TaskMeta, K as TaskPopulated, L as TaskResult, M as TaskResultPack, N as TaskState, d as TaskUpdateEvent, a as Test, f as TestAPI, P as TestAnnotation, Q as TestAnnotationArtifact, U as TestAnnotationLocation, T as TestArtifact, W as TestArtifactBase, X as TestArtifactLocation, Y as TestArtifactRegistry, Z as TestAttachment, _ as TestContext, $ as TestFunction, a0 as TestOptions, a1 as TestTagDefinition, a2 as TestTags, a3 as Use, a4 as VisualRegressionArtifact, V as VitestRunner, a5 as VitestRunnerConfig, a6 as VitestRunnerConstructor, a7 as VitestRunnerImportSource } from './tasks.d-D2GKpdwQ.js';
1
+ export { A as AfterAllListener, i as AfterEachListener, j as AroundAllListener, k as AroundEachListener, B as BeforeAllListener, l as BeforeEachListener, C as CancelReason, m as FailureScreenshotArtifact, c as File, F as FileSpecification, n as Fixture, o as FixtureFn, p as FixtureOptions, q as Fixtures, I as ImportDuration, r as InferFixturesTypes, O as OnTestFailedHandler, s as OnTestFinishedHandler, R as Retry, t as RunMode, u as RuntimeContext, v as SequenceHooks, w as SequenceSetupFiles, x as SerializableRetry, S as Suite, g as SuiteAPI, h as SuiteCollector, y as SuiteFactory, b as SuiteHooks, z as SuiteOptions, e as Task, D as TaskBase, E as TaskCustomOptions, G as TaskEventPack, H as TaskHook, J as TaskMeta, K as TaskPopulated, L as TaskResult, M as TaskResultPack, N as TaskState, d as TaskUpdateEvent, a as Test, f as TestAPI, P as TestAnnotation, Q as TestAnnotationArtifact, U as TestAnnotationLocation, T as TestArtifact, W as TestArtifactBase, X as TestArtifactLocation, Y as TestArtifactRegistry, Z as TestAttachment, _ as TestContext, $ as TestFunction, a0 as TestOptions, a1 as TestTagDefinition, a2 as TestTags, a3 as Use, a4 as VisualRegressionArtifact, V as VitestRunner, a5 as VitestRunnerConfig, a6 as VitestRunnerConstructor, a7 as VitestRunnerImportSource } from './tasks.d-DI5LbrqA.js';
2
2
  import '@vitest/utils';
3
3
  import '@vitest/utils/diff';
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as Suite, c as File, e as Task, a1 as TestTagDefinition, a5 as VitestRunnerConfig, a as Test } from './tasks.d-D2GKpdwQ.js';
2
- export { ag as ChainableFunction, ah as createChainable } from './tasks.d-D2GKpdwQ.js';
1
+ import { S as Suite, c as File, e as Task, a1 as TestTagDefinition, a5 as VitestRunnerConfig, a as Test } from './tasks.d-DI5LbrqA.js';
2
+ export { ag as ChainableFunction, ah as createChainable } from './tasks.d-DI5LbrqA.js';
3
3
  import { ParsedStack, Arrayable } from '@vitest/utils';
4
4
  import '@vitest/utils/diff';
5
5
 
@@ -36,6 +36,10 @@ declare function limitConcurrency(concurrency?: number): ConcurrencyLimiter;
36
36
  */
37
37
  declare function partitionSuiteChildren(suite: Suite): Task[][];
38
38
 
39
+ /**
40
+ * @experimental
41
+ */
42
+ declare function matchesTags(testTags: string[]): boolean;
39
43
  declare function validateTags(config: VitestRunnerConfig, tags: string[]): void;
40
44
  declare function createTagsFilter(tagsExpr: string[], availableTags: TestTagDefinition[]): (testTags: string[]) => boolean;
41
45
 
@@ -50,4 +54,4 @@ declare function getFullName(task: Task, separator?: string): string;
50
54
  declare function getTestName(task: Task, separator?: string): string;
51
55
  declare function createTaskName(names: readonly (string | undefined)[], separator?: string): string;
52
56
 
53
- export { calculateSuiteHash, createFileTask, createTagsFilter, createTaskName, findTestFileStackTrace, generateFileHash, generateHash, getFullName, getNames, getSuites, getTasks, getTestName, getTests, hasFailed, hasTests, interpretTaskModes, isTestCase, limitConcurrency, partitionSuiteChildren, someTasksAreOnly, validateTags };
57
+ export { calculateSuiteHash, createFileTask, createTagsFilter, createTaskName, findTestFileStackTrace, generateFileHash, generateHash, getFullName, getNames, getSuites, getTasks, getTestName, getTests, hasFailed, hasTests, interpretTaskModes, isTestCase, limitConcurrency, matchesTags, partitionSuiteChildren, someTasksAreOnly, validateTags };
package/dist/utils.js CHANGED
@@ -1,5 +1,7 @@
1
- export { c as calculateSuiteHash, a as createChainable, b as createFileTask, d as createTagsFilter, e as createTaskName, f as findTestFileStackTrace, g as generateFileHash, h as generateHash, i as getFullName, j as getNames, k as getSuites, l as getTasks, m as getTestName, n as getTests, o as hasFailed, p as hasTests, q as interpretTaskModes, r as isTestCase, s as limitConcurrency, t as partitionSuiteChildren, u as someTasksAreOnly, v as validateTags } from './chunk-tasks.js';
1
+ export { x as calculateSuiteHash, y as createChainable, z as createFileTask, A as createTagsFilter, B as createTaskName, C as findTestFileStackTrace, D as generateFileHash, E as generateHash, F as getFullName, G as getNames, H as getSuites, I as getTasks, J as getTestName, K as getTests, L as hasFailed, M as hasTests, N as interpretTaskModes, O as isTestCase, P as limitConcurrency, Q as matchesTags, R as partitionSuiteChildren, S as someTasksAreOnly, T as validateTags } from './chunk-artifact.js';
2
2
  import '@vitest/utils/error';
3
+ import '@vitest/utils/helpers';
4
+ import '@vitest/utils/timers';
5
+ import '@vitest/utils/display';
3
6
  import '@vitest/utils/source-map';
4
7
  import 'pathe';
5
- import '@vitest/utils/helpers';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/runner",
3
3
  "type": "module",
4
- "version": "4.1.0",
4
+ "version": "4.1.2",
5
5
  "description": "Vitest test runner",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -44,7 +44,7 @@
44
44
  ],
45
45
  "dependencies": {
46
46
  "pathe": "^2.0.3",
47
- "@vitest/utils": "4.1.0"
47
+ "@vitest/utils": "4.1.2"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "premove dist && rollup -c",