Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
fix: bring ITestCallbackContext in from mocha
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
jdx committed May 7, 2018
1 parent 06fe88a commit d011192
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as mocha from 'mocha'

export type PluginBuilder<I, A1 = undefined, A2 = undefined, A3 = undefined, A4 = undefined> = (arg1?: A1, arg2?: A2, arg3?: A3, arg4?: A4) => Plugin<I>

export interface Context {
Expand Down Expand Up @@ -28,7 +26,15 @@ export interface PluginDef {

export interface Plugins {[k: string]: PluginDef}

export type MochaCallback<I> = (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<I> = (this: ITestCallbackContext, context: I, done: MochaDone) => any
export interface It<I> {
(expectation: string, cb?: MochaCallback<I>): void
(cb?: MochaCallback<I>): void
Expand Down

0 comments on commit d011192

Please sign in to comment.