diff --git a/package.json b/package.json index b7abf74..9638ecd 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "dependencies": { "@types/chai": "*", "@types/lodash": "*", - "@types/mocha": "*", "@types/node": "*", "@types/sinon": "*", "lodash": "^4.17.13", @@ -15,6 +14,7 @@ "stdout-stderr": "^0.1.9" }, "devDependencies": { + "@types/mocha": "*", "chai": "^4.2.0", "chalk": "^2.4.2", "eslint": "^6.6.0", diff --git a/src/base.ts b/src/base.ts index ed28a8c..d7a7d5f 100644 --- a/src/base.ts +++ b/src/base.ts @@ -35,7 +35,7 @@ const base = (context: I): Types.Base => { 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) { diff --git a/src/types.ts b/src/types.ts index c1f5860..c369b0e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -34,7 +34,7 @@ export interface ITestCallbackContext { [index: string]: any; } -export type MochaCallback = (this: ITestCallbackContext, context: I, done: Mocha.Done) => any +export type MochaCallback = (this: ITestCallbackContext, context: I, done: MochaDone) => any export interface It { (expectation: string, cb?: MochaCallback): void; (cb?: MochaCallback): void; @@ -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