@vitest/runner 3.0.9 → 3.1.0-beta.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.
@@ -333,6 +333,7 @@ interface ExtendedAPI<ExtraContext> {
333
333
  }
334
334
  type TestAPI<ExtraContext = object> = ChainableTestAPI<ExtraContext> & ExtendedAPI<ExtraContext> & {
335
335
  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 }>
336
+ scoped: (fixtures: Fixtures<Partial<ExtraContext>>) => void
336
337
  };
337
338
 
338
339
  interface FixtureOptions {
@@ -433,6 +434,8 @@ interface SuiteCollector<ExtraContext = object> {
433
434
  type: "collector";
434
435
  test: TestAPI<ExtraContext>;
435
436
  tasks: (Suite | Test<ExtraContext> | SuiteCollector<ExtraContext>)[];
437
+ scoped: (fixtures: Fixtures<any, ExtraContext>) => void;
438
+ fixtures: () => FixtureItem[] | undefined;
436
439
  suite?: Suite;
437
440
  task: (name: string, options?: TaskCustomOptions) => Test<ExtraContext>;
438
441
  collect: (file: File) => Promise<Suite>;
@@ -464,7 +467,10 @@ interface TestContext {
464
467
  * Mark tests as skipped. All execution after this call will be skipped.
465
468
  * This function throws an error, so make sure you are not catching it accidentally.
466
469
  */
467
- skip: (note?: string) => never;
470
+ skip: {
471
+ (note?: string): never
472
+ (condition: boolean, note?: string): void
473
+ };
468
474
  }
469
475
  /**
470
476
  * Context that's always available in the test function.
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DiffOptions } from '@vitest/utils/diff';
2
- import { F as File, T as Task, a as Test, S as Suite, K as TaskResultPack, y as TaskEventPack, M as TestContext, s as SequenceHooks, t as SequenceSetupFiles } from './tasks.d-D4e98wjH.js';
3
- export { A as AfterAllListener, b as AfterEachListener, B as BeforeAllListener, d as BeforeEachListener, g as Custom, j as CustomAPI, D as DoneCallback, E as ExtendedContext, m as Fixture, n as FixtureFn, o as FixtureOptions, p as Fixtures, H as HookCleanupCallback, q as HookListener, I as InferFixturesTypes, O as OnTestFailedHandler, f as OnTestFinishedHandler, R as RunMode, r as RuntimeContext, k as SuiteAPI, l as SuiteCollector, u as SuiteFactory, h as SuiteHooks, v as TaskBase, w as TaskContext, x as TaskCustomOptions, e as TaskHook, z as TaskMeta, G as TaskPopulated, J as TaskResult, L as TaskState, i as TaskUpdateEvent, j as TestAPI, N as TestFunction, P as TestOptions, U as Use } from './tasks.d-D4e98wjH.js';
2
+ import { F as File, T as Task, a as Test, S as Suite, K as TaskResultPack, y as TaskEventPack, M as TestContext, s as SequenceHooks, t as SequenceSetupFiles } from './tasks.d-CnuPOyeL.js';
3
+ export { A as AfterAllListener, b as AfterEachListener, B as BeforeAllListener, d as BeforeEachListener, g as Custom, j as CustomAPI, D as DoneCallback, E as ExtendedContext, m as Fixture, n as FixtureFn, o as FixtureOptions, p as Fixtures, H as HookCleanupCallback, q as HookListener, I as InferFixturesTypes, O as OnTestFailedHandler, f as OnTestFinishedHandler, R as RunMode, r as RuntimeContext, k as SuiteAPI, l as SuiteCollector, u as SuiteFactory, h as SuiteHooks, v as TaskBase, w as TaskContext, x as TaskCustomOptions, e as TaskHook, z as TaskMeta, G as TaskPopulated, J as TaskResult, L as TaskState, i as TaskUpdateEvent, j as TestAPI, N as TestFunction, P as TestOptions, U as Use } from './tasks.d-CnuPOyeL.js';
4
4
  import '@vitest/utils';
5
5
 
6
6
  /**
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as Suite, F as File, T as Task, a as Test } from './tasks.d-D4e98wjH.js';
2
- export { C as ChainableFunction, c as createChainable } from './tasks.d-D4e98wjH.js';
1
+ import { S as Suite, F as File, T as Task, a as Test } from './tasks.d-CnuPOyeL.js';
2
+ export { C as ChainableFunction, c as createChainable } from './tasks.d-CnuPOyeL.js';
3
3
  import { Arrayable } from '@vitest/utils';
4
4
 
5
5
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/runner",
3
3
  "type": "module",
4
- "version": "3.0.9",
4
+ "version": "3.1.0-beta.2",
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": "3.0.9"
42
+ "@vitest/utils": "3.1.0-beta.2"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "rimraf dist && rollup -c",