diff --git a/types/jasmine/index.d.ts b/types/jasmine/index.d.ts index 8e8ca9489f..a25d28a715 100644 --- a/types/jasmine/index.d.ts +++ b/types/jasmine/index.d.ts @@ -454,6 +454,12 @@ declare namespace jasmine { toThrowError(message?: string | RegExp): boolean; toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean; + /** + * Add some context for an expect. + * @param message - Additional context to show when the matcher fails + */ + withContext(message: string): Matchers; + not: Matchers; Any: Any; diff --git a/types/jasmine/jasmine-tests.ts b/types/jasmine/jasmine-tests.ts index e96293ced4..11bfbca2b2 100644 --- a/types/jasmine/jasmine-tests.ts +++ b/types/jasmine/jasmine-tests.ts @@ -246,6 +246,12 @@ describe("A spec", () => { }); }); +describe("withContext", () => { + it("can be used after an expectation", () => { + expect(1).withContext('context message').toBe(1); + }); +}); + xdescribe("A spec", () => { var foo: number;