From d0111928df307a7435d8e23645e529d39e648adf Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Mon, 7 May 2018 16:33:38 -0700 Subject: [PATCH] fix: bring ITestCallbackContext in from mocha Fixes https://github.com/jdxcode/fancy-test/issues/11 --- src/types.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/types.ts b/src/types.ts index 56c6dfc..666d999 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,3 @@ -import * as mocha from 'mocha' - export type PluginBuilder = (arg1?: A1, arg2?: A2, arg3?: A3, arg4?: A4) => Plugin export interface Context { @@ -28,7 +26,15 @@ export interface PluginDef { export interface Plugins {[k: string]: PluginDef} -export type MochaCallback = (this: mocha.ITestCallbackContext, context: I, done: MochaDone) => any +export interface ITestCallbackContext { + skip(): this + timeout(ms: number | string): this + retries(n: number): this + slow(ms: number): this + [index: string]: any +} + +export type MochaCallback = (this: ITestCallbackContext, context: I, done: MochaDone) => any export interface It { (expectation: string, cb?: MochaCallback): void (cb?: MochaCallback): void