From 120a41c4399c555075708886ea451e73df9cc221 Mon Sep 17 00:00:00 2001 From: Daniel Syddall Date: Sun, 19 Nov 2023 04:56:16 +0000 Subject: [PATCH] chore(bench): extract ChainableBenchmarkAPI type --- packages/vitest/src/types/benchmark.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/vitest/src/types/benchmark.ts b/packages/vitest/src/types/benchmark.ts index 62a36dd6c90f..b869624d8059 100644 --- a/packages/vitest/src/types/benchmark.ts +++ b/packages/vitest/src/types/benchmark.ts @@ -52,13 +52,14 @@ export interface BenchmarkResult extends TinybenchResult { } export type BenchFunction = (this: BenchFactory) => Promise | 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 {