Skip to content

Commit

Permalink
fix(bench): extract ChainableBenchmarkAPI type (#4537)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyddall committed Nov 28, 2023
1 parent 23a55e8 commit 79e9bfa
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/vitest/src/types/benchmark.ts
Expand Up @@ -52,13 +52,14 @@ export interface BenchmarkResult extends TinybenchResult {
}

export type BenchFunction = (this: BenchFactory) => Promise<void> | void
export type BenchmarkAPI = ChainableFunction<
'skip' | 'only' | 'todo',
[name: string | Function, fn?: BenchFunction, options?: BenchOptions],
void
> & {
skipIf(condition: any): BenchmarkAPI
runIf(condition: any): BenchmarkAPI
type ChainableBenchmarkAPI = ChainableFunction<
'skip' | 'only' | 'todo',
[name: string | Function, fn?: BenchFunction, options?: BenchOptions],
void
>
export type BenchmarkAPI = ChainableBenchmarkAPI & {
skipIf(condition: any): ChainableBenchmarkAPI
runIf(condition: any): ChainableBenchmarkAPI
}

export {
Expand Down

0 comments on commit 79e9bfa

Please sign in to comment.