Skip to content

Commit

Permalink
Merge pull request #15 from iensu/feature/typescript-definitions-for-…
Browse files Browse the repository at this point in the history
…scenario-feature-hooks

Feature/typescript definitions for scenario feature hooks
  • Loading branch information
iensu authored Mar 7, 2018
2 parents 489729b + 69cb3b4 commit 1eaf524
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions mocha-cakes.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
interface MochaCakesTestFn {
(t: string, f: Function): any;
only(t: string, f: Function): any;
skip(t: string, f: Function): any;
(description: string, testFn: Function): any;
only(description: string, testFn: Function): any;
skip(description: string, testFn: Function): any;
}

interface MochaCakesDone {
(error?: any): any
}

interface MochaCakesHookCallback {
(done: MochaCakesDone): void;
}

interface MochaCakesHook {
(callback: MochaCakesHookCallback): void;
(description: string, callback: MochaCakesHookCallback): void;
}

declare var Feature: MochaCakesTestFn;
Expand All @@ -19,3 +32,8 @@ declare var and: MochaCakesTestFn;
declare var when: MochaCakesTestFn;
declare var then: MochaCakesTestFn;
declare var but: MochaCakesTestFn;

declare var afterEachFeature: MochaCakesHook;
declare var beforeEachFeature: MochaCakesHook;
declare var afterEachScenario: MochaCakesHook;
declare var beforeEachScenario: MochaCakesHook;

0 comments on commit 1eaf524

Please sign in to comment.