-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The way how it is defined as a callable ITestDefinition interface makes it impossible for TS to infer the type of the done callback.
declare var it: Mocha.ITestDefinition;
interface ITestDefinition {
(expectation: string, assertion?: () => void): ITest;
(expectation: string, assertion?: (done: MochaDone) => void): ITest;
only(expectation: string, assertion?: () => void): ITest;
only(expectation: string, assertion?: (done: MochaDone) => void): ITest;
skip(expectation: string, assertion?: () => void): void;
skip(expectation: string, assertion?: (done: MochaDone) => void): void;
timeout(ms: number): void;
}Doing
it('whatever', done => {
});yields
src/test/dbgp.ts(24,53): error TS7006: Parameter 'done' implicitly has an 'any' type.
This used to work. Now we have to do
it('whatever', (done: MochaDone) => {
});Metadata
Metadata
Assignees
Labels
No labels