From 675a63e4036624d24b06f1b173a92cbe7bb72ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pa=CC=88rsson?= Date: Wed, 4 Feb 2015 11:28:29 +0100 Subject: [PATCH] Added global fail() function to Jasmine typings --- jasmine/jasmine-tests.ts | 16 ++++++++++++++++ jasmine/jasmine.d.ts | 2 ++ 2 files changed, 18 insertions(+) diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index 1a9b1b2e4..cbac45d16 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -714,6 +714,22 @@ describe("Asynchronous specs", function () { }); }); +describe("Fail", function () { + + it("should fail test when called without arguments", function () { + fail(); + }); + + it("should fail test when called with a fail message", function () { + fail("The test failed"); + }); + + it("should fail test when called an error", function () { + fail(new Error("The test failed with this error")); + }); + +}); + (() => { // from boot.js var env = jasmine.getEnv(); diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index 6c323e146..3d5e48669 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -33,6 +33,8 @@ declare function afterAll(action: (done: () => void) => void): void; declare function expect(spy: Function): jasmine.Matchers; declare function expect(actual: any): jasmine.Matchers; +declare function fail(e?: any): void; + declare function spyOn(object: any, method: string): jasmine.Spy; declare function runs(asyncMethod: Function): void;