Skip to content

Commit

Permalink
chore(bench): extract ChainableBenchmarkAPI type
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyddall committed Nov 19, 2023
1 parent abe6c72 commit 120a41c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/vitest/src/types/benchmark.ts
Original file line number Diff line number Diff line change
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 120a41c

Please sign in to comment.