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;