diff --git a/types/jasminewd2/index.d.ts b/types/jasminewd2/index.d.ts index d19b929fa7..66b5708aa5 100644 --- a/types/jasminewd2/index.d.ts +++ b/types/jasminewd2/index.d.ts @@ -1,18 +1,19 @@ // Type definitions for jasminewd2 2.0 // Project: https://github.com/angular/jasminewd // Definitions by: Sammy Jelin +// George Kalpakas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 /// -declare function it(expectation: string, assertion?: () => Promise, timeout?: number): void; -declare function fit(expectation: string, assertion?: () => Promise, timeout?: number): void; -declare function xit(expectation: string, assertion?: () => Promise, timeout?: number): void; -declare function beforeEach(action: () => Promise, timeout?: number): void; -declare function afterEach(action: () => Promise, timeout?: number): void; -declare function beforeAll(action: () => Promise, timeout?: number): void; -declare function afterAll(action: () => Promise, timeout?: number): void; +declare function it(expectation: string, assertion?: (done: DoneFn) => Promise, timeout?: number): void; +declare function fit(expectation: string, assertion?: (done: DoneFn) => Promise, timeout?: number): void; +declare function xit(expectation: string, assertion?: (done: DoneFn) => Promise, timeout?: number): void; +declare function beforeEach(action: (done: DoneFn) => Promise, timeout?: number): void; +declare function afterEach(action: (done: DoneFn) => Promise, timeout?: number): void; +declare function beforeAll(action: (done: DoneFn) => Promise, timeout?: number): void; +declare function afterAll(action: (done: DoneFn) => Promise, timeout?: number): void; declare namespace jasmine { interface Matchers { diff --git a/types/jasminewd2/jasminewd2-tests.ts b/types/jasminewd2/jasminewd2-tests.ts index e201ed3cc0..aeb4540265 100644 --- a/types/jasminewd2/jasminewd2-tests.ts +++ b/types/jasminewd2/jasminewd2-tests.ts @@ -1,6 +1,4 @@ -let promise = new Promise((resolve, reject) => { - resolve(); -}); +const promise = Promise.resolve(); describe('jasminewd', () => { describe('global it, fit, xit, before and after', () => { @@ -31,6 +29,34 @@ describe('jasminewd', () => { afterAll(() => { return promise; }); + + it('should be able to use DoneFn', done => { + promise.then(done, done.fail); + }); + + fit('should be able to use DoneFn', done => { + promise.then(done, done.fail); + }); + + xit('should be able to use DoneFn', done => { + promise.then(done, done.fail); + }); + + beforeEach(done => { + promise.then(done, done.fail); + }); + + afterEach(done => { + promise.then(done, done.fail); + }); + + beforeAll(done => { + promise.then(done, done.fail); + }); + + afterAll(done => { + promise.then(done, done.fail); + }); }); describe('matchers', () => {