From 2fc7d56475ca1d77078abc3e08390341bedda58f Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Sun, 14 Jul 2019 17:23:56 +0200 Subject: [PATCH] Change default Context type to unknown --- index.d.ts | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/index.d.ts b/index.d.ts index d909be908..5f1501fa0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -353,7 +353,7 @@ export interface TruthyAssertion { } /** The `t` value passed to test & hook implementations. */ -export interface ExecutionContext extends Assertions { +export interface ExecutionContext extends Assertions { /** Test context, shared with hooks. */ context: Context; @@ -393,7 +393,7 @@ export interface TimeoutFn { } /** The `t` value passed to implementations for tests & hooks declared with the `.cb` modifier. */ -export interface CbExecutionContext extends ExecutionContext { +export interface CbExecutionContext extends ExecutionContext { /** * End the test. If `error` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) the test or hook * will fail. @@ -402,14 +402,14 @@ export interface CbExecutionContext extends ExecutionContext | ObservableLike | void; -export type Implementation = (t: ExecutionContext) => ImplementationResult; -export type CbImplementation = (t: CbExecutionContext) => ImplementationResult; +export type Implementation = (t: ExecutionContext) => ImplementationResult; +export type CbImplementation = (t: CbExecutionContext) => ImplementationResult; /** A reusable test or hook implementation. */ -export type UntitledMacro = (t: ExecutionContext, ...args: Args) => ImplementationResult; +export type UntitledMacro = (t: ExecutionContext, ...args: Args) => ImplementationResult; /** A reusable test or hook implementation. */ -export type Macro = UntitledMacro & { +export type Macro = UntitledMacro & { /** * Implement this function to generate a test (or hook) title whenever this macro is used. `providedTitle` contains * the title provided when the test or hook was declared. Also receives the remaining test arguments. @@ -423,10 +423,10 @@ export type EitherMacro = Macro | Un export type OneOrMoreMacros = EitherMacro | [EitherMacro, ...EitherMacro[]]; /** A reusable test or hook implementation, for tests & hooks declared with the `.cb` modifier. */ -export type UntitledCbMacro = (t: CbExecutionContext, ...args: Args) => ImplementationResult +export type UntitledCbMacro = (t: CbExecutionContext, ...args: Args) => ImplementationResult /** A reusable test or hook implementation, for tests & hooks declared with the `.cb` modifier. */ -export type CbMacro = UntitledCbMacro & { +export type CbMacro = UntitledCbMacro & { title?: (providedTitle: string | undefined, ...args: Args) => string; } @@ -435,7 +435,7 @@ export type EitherCbMacro = CbMacro /** Alias for a single macro, or an array of macros, used for tests & hooks declared with the `.cb` modifier. */ export type OneOrMoreCbMacros = EitherCbMacro | [EitherCbMacro, ...EitherCbMacro[]]; -export interface TestInterface { +export interface TestInterface { /** Declare a concurrent test. */ (title: string, implementation: Implementation): void; @@ -472,7 +472,7 @@ export interface TestInterface { meta: MetaInterface; } -export interface AfterInterface { +export interface AfterInterface { /** Declare a hook that is run once, after all tests have passed. */ (implementation: Implementation): void; @@ -494,7 +494,7 @@ export interface AfterInterface { skip: HookSkipInterface; } -export interface AlwaysInterface { +export interface AlwaysInterface { /** Declare a hook that is run once, after all tests are done. */ (implementation: Implementation): void; @@ -513,7 +513,7 @@ export interface AlwaysInterface { skip: HookSkipInterface; } -export interface BeforeInterface { +export interface BeforeInterface { /** Declare a hook that is run once, before all tests. */ (implementation: Implementation): void; @@ -532,7 +532,7 @@ export interface BeforeInterface { skip: HookSkipInterface; } -export interface CbInterface { +export interface CbInterface { /** Declare a test that must call `t.end()` when it's done. */ (title: string, implementation: CbImplementation): void; @@ -555,7 +555,7 @@ export interface CbInterface { skip: CbSkipInterface; } -export interface CbFailingInterface { +export interface CbFailingInterface { /** Declare a test that must call `t.end()` when it's done. The test is expected to fail. */ (title: string, implementation: CbImplementation): void; @@ -575,7 +575,7 @@ export interface CbFailingInterface { skip: CbSkipInterface; } -export interface CbOnlyInterface { +export interface CbOnlyInterface { /** * Declare a test that must call `t.end()` when it's done. Only this test and others declared with `.only()` are run. */ @@ -594,7 +594,7 @@ export interface CbOnlyInterface { (macros: OneOrMoreCbMacros, ...rest: T): void; } -export interface CbSkipInterface { +export interface CbSkipInterface { /** Skip this test. */ (title: string, implementation: CbImplementation): void; @@ -605,7 +605,7 @@ export interface CbSkipInterface { (macros: OneOrMoreCbMacros, ...rest: T): void; } -export interface FailingInterface { +export interface FailingInterface { /** Declare a concurrent test. The test is expected to fail. */ (title: string, implementation: Implementation): void; @@ -625,7 +625,7 @@ export interface FailingInterface { skip: SkipInterface; } -export interface HookCbInterface { +export interface HookCbInterface { /** Declare a hook that must call `t.end()` when it's done. */ (implementation: CbImplementation): void; @@ -646,7 +646,7 @@ export interface HookCbInterface { skip: HookCbSkipInterface; } -export interface HookCbSkipInterface { +export interface HookCbSkipInterface { /** Skip this hook. */ (implementation: CbImplementation): void; @@ -660,7 +660,7 @@ export interface HookCbSkipInterface { (macros: OneOrMoreCbMacros, ...rest: T): void; } -export interface HookSkipInterface { +export interface HookSkipInterface { /** Skip this hook. */ (implementation: Implementation): void; @@ -674,7 +674,7 @@ export interface HookSkipInterface { (macros: OneOrMoreMacros, ...rest: T): void; } -export interface OnlyInterface { +export interface OnlyInterface { /** Declare a test. Only this test and others declared with `.only()` are run. */ (title: string, implementation: Implementation): void; @@ -691,7 +691,7 @@ export interface OnlyInterface { (macros: OneOrMoreMacros, ...rest: T): void; } -export interface SerialInterface { +export interface SerialInterface { /** Declare a serial test. */ (title: string, implementation: Implementation): void; @@ -726,7 +726,7 @@ export interface SerialInterface { todo: TodoDeclaration; } -export interface SkipInterface { +export interface SkipInterface { /** Skip this test. */ (title: string, implementation: Implementation): void;