Merge pull request #30059 from cexbrayat/feat/jasmine-with-context

Jasmine: Adds withContext method on Matcher<T>
This commit is contained in:
Armando Aguirre
2018-11-05 15:07:40 -08:00
committed by GitHub
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -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<T>;
not: Matchers<T>;
Any: Any;
+6
View File
@@ -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;