Update Jasmine to 3.0 (#30261)

* Update Jasmine to 3.3

* Update index.d.ts

* Update index.d.ts

Change targeted version to 3.0.0 as all additional matchers are in 3.0.0 as well as 3.3.0

* Update index.d.ts

Remove nothing from `Matchers<T>`

* Update jasmine-tests.ts

Remove nothing from tests on Matcher
This commit is contained in:
Roaders
2018-11-16 16:40:01 -08:00
committed by Pranav Senthilnathan
parent f1e4894762
commit ed9b273ae4
2 changed files with 24 additions and 1 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for Jasmine 2.8.0
// Type definitions for Jasmine 3.0.0
// Project: http://jasmine.github.io/
// Definitions by: Boris Yankov <https://github.com/borisyankov>
// Theodore Brown <https://github.com/theodorejb>
@@ -7,6 +7,7 @@
// Lukas Zech <https://github.com/lukas-zech-software>
// Boris Breuer <https://github.com/Engineer2B>
// Chris Yungmann <https://github.com/cyungmann>
// Giles Roadnight <https://github.com/Roaders>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts
@@ -453,6 +454,10 @@ declare namespace jasmine {
toThrow(expected?: any): boolean;
toThrowError(message?: string | RegExp): boolean;
toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean;
toThrowMatching(predicate: (thrown: any) => boolean): boolean;
toBeNegativeInfinity(expectationFailOutput?: any): boolean;
toBePositiveInfinity(expectationFailOutput?: any): boolean;
toHaveClass(expected: any, expectationFailOutput?: any): boolean;
/**
* Add some context for an expect.
+18
View File
@@ -173,6 +173,24 @@ describe("Included matchers:", () => {
});
});
describe("toThrowMatching", () => {
expect(() => {
({} as any).doSomething();
}).toThrowMatching(error => error != undefined);
});
describe("toBeNegativeInfinity", () => {
expect("").toBeNegativeInfinity();
});
describe("toBePositiveInfinity", () => {
expect("").toBePositiveInfinity();
});
describe("toHaveClass", () => {
expect("").toHaveClass(Array);
});
describe("A spec", () => {
it("is just a function, so it can contain any code", () => {
var foo = 0;