diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index cbac45d16..ef0572303 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -712,6 +712,23 @@ describe("Asynchronous specs", function () { expect(value).toBeGreaterThan(0); done(); }); + + describe("long asynchronous specs", function() { + beforeEach(function(done) { + done(); + }, 1000); + + it("takes a long time", function(done) { + setTimeout(function() { + done(); + }, 9000); + }, 10000); + + afterEach(function(done) { + done(); + }, 1000); + }); + }); describe("Fail", function () { diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index efa0a62ae..3727f8839 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -10,25 +10,25 @@ declare function describe(description: string, specDefinitions: () => void): voi declare function fdescribe(description: string, specDefinitions: () => void): void; declare function xdescribe(description: string, specDefinitions: () => void): void; -declare function it(expectation: string, assertion?: () => void): void; -declare function it(expectation: string, assertion?: (done: () => void) => void): void; -declare function fit(expectation: string, assertion?: () => void): void; -declare function fit(expectation: string, assertion?: (done: () => void) => void): void; -declare function xit(expectation: string, assertion?: () => void): void; -declare function xit(expectation: string, assertion?: (done: () => void) => void): void; +declare function it(expectation: string, assertion?: () => void, timeout?: number): void; +declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function fit(expectation: string, assertion?: () => void, timeout?: number): void; +declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function xit(expectation: string, assertion?: () => void, timeout?: number): void; +declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; /** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */ declare function pending(): void; -declare function beforeEach(action: () => void): void; -declare function beforeEach(action: (done: () => void) => void): void; -declare function afterEach(action: () => void): void; -declare function afterEach(action: (done: () => void) => void): void; +declare function beforeEach(action: () => void, timeout?: number): void; +declare function beforeEach(action: (done: () => void) => void, timeout?: number): void; +declare function afterEach(action: () => void, timeout?: number): void; +declare function afterEach(action: (done: () => void) => void, timeout?: number): void; -declare function beforeAll(action: () => void): void; -declare function beforeAll(action: (done: () => void) => void): void; -declare function afterAll(action: () => void): void; -declare function afterAll(action: (done: () => void) => void): void; +declare function beforeAll(action: () => void, timeout?: number): void; +declare function beforeAll(action: (done: () => void) => void, timeout?: number): void; +declare function afterAll(action: () => void, timeout?: number): void; +declare function afterAll(action: (done: () => void) => void, timeout?: number): void; declare function expect(spy: Function): jasmine.Matchers; declare function expect(actual: any): jasmine.Matchers;