@@ -2,7 +2,12 @@ import path from 'node:path'
2
2
import process from 'node:process'
3
3
import { normalizePath } from '@rollup/pluginutils'
4
4
import { glob , type GlobOptions } from 'tinyglobby'
5
- import { describe , expect , test } from 'vitest'
5
+ import {
6
+ describe ,
7
+ expect as globalExpect ,
8
+ test ,
9
+ type ExpectStatic ,
10
+ } from 'vitest'
6
11
7
12
type SkipFn = ( testName : string ) => boolean | Promise < boolean >
8
13
let isSkip : SkipFn | undefined
@@ -13,6 +18,7 @@ export function testFixturesSkip(fn: SkipFn): void {
13
18
export interface FixtureOptions {
14
19
params ?: [ name : string , values ?: any [ ] ] [ ]
15
20
promise ?: boolean
21
+ expect ?: ExpectStatic
16
22
}
17
23
18
24
export async function testFixtures (
@@ -28,7 +34,12 @@ export async function testFixtures(
28
34
export async function testFixtures (
29
35
globsOrFiles : string | string [ ] | Record < string , string > ,
30
36
cb : ( args : Record < string , any > , id : string , code : string ) => any ,
31
- { params, promise, ...globOptions } : GlobOptions & FixtureOptions = { } ,
37
+ {
38
+ params,
39
+ promise,
40
+ expect = globalExpect ,
41
+ ...globOptions
42
+ } : GlobOptions & FixtureOptions = { } ,
32
43
) {
33
44
let files : Record < string , string | undefined >
34
45
0 commit comments