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

fix: bring Done in from mocha #50

Merged
merged 1 commit into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"dependencies": {
"@types/chai": "*",
"@types/lodash": "*",
"@types/mocha": "*",
"@types/node": "*",
"@types/sinon": "*",
"lodash": "^4.17.13",
"mock-stdin": "^0.3.1",
"stdout-stderr": "^0.1.9"
},
"devDependencies": {
"@types/mocha": "*",
"chai": "^4.2.0",
"chalk": "^2.4.2",
"eslint": "^6.6.0",
Expand Down
2 changes: 1 addition & 1 deletion src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const base = <I extends Types.Context>(context: I): Types.Base<I, {}> => {
arg1 = undefined
}
if (!arg1) arg1 = context.expectation || 'test'
async function run(this: Types.ITestCallbackContext, done?: Mocha.Done) {
async function run(this: Types.ITestCallbackContext, done?: Types.MochaDone) {
context = assignWithProps({}, originalContext)
if (context.retries) this.retries(context.retries)
if (cb) {
Expand Down
4 changes: 3 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface ITestCallbackContext {
[index: string]: any;
}

export type MochaCallback<I> = (this: ITestCallbackContext, context: I, done: Mocha.Done) => 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 All @@ -53,6 +53,8 @@ export interface EnvOptions {
clear?: boolean;
}

export type MochaDone = (err?: any) => void

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface NockScope extends Nock.Scope {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down