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

Commit

Permalink
fix: bring Done in from mocha (#50)
Browse files Browse the repository at this point in the history
Also move @types/mocha to devDependencies since it's no longer directly
used
  • Loading branch information
garrettjstevens authored Jul 2, 2020
1 parent f413161 commit 49c3c77
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
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": "^1.0.0",
"stdout-stderr": "^0.1.9"
},
"devDependencies": {
"@types/mocha": "*",
"chai": "^4.2.0",
"chalk": "^2.4.2",
"eslint": "^7.3.1",
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

0 comments on commit 49c3c77

Please sign in to comment.