Skip to content

Commit 79e9bfa

Browse files
authoredNov 28, 2023
fix(bench): extract ChainableBenchmarkAPI type (#4537)
1 parent 23a55e8 commit 79e9bfa

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed
 

Diff for: ‎packages/vitest/src/types/benchmark.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ export interface BenchmarkResult extends TinybenchResult {
5252
}
5353

5454
export type BenchFunction = (this: BenchFactory) => Promise<void> | void
55-
export type BenchmarkAPI = ChainableFunction<
56-
'skip' | 'only' | 'todo',
57-
[name: string | Function, fn?: BenchFunction, options?: BenchOptions],
58-
void
59-
> & {
60-
skipIf(condition: any): BenchmarkAPI
61-
runIf(condition: any): BenchmarkAPI
55+
type ChainableBenchmarkAPI = ChainableFunction<
56+
'skip' | 'only' | 'todo',
57+
[name: string | Function, fn?: BenchFunction, options?: BenchOptions],
58+
void
59+
>
60+
export type BenchmarkAPI = ChainableBenchmarkAPI & {
61+
skipIf(condition: any): ChainableBenchmarkAPI
62+
runIf(condition: any): ChainableBenchmarkAPI
6263
}
6364

6465
export {

0 commit comments

Comments
 (0)
Please sign in to comment.