I use jasmine in an angular2 project and have some problems writing a custom match for the test. I want to be able to compare two relatively complex objects. I found this article , which claims to solve the problem, but simply leads to a typescript error stating that it does not recognize the new method on the jasmine object Matchers
. Relevant Code:
declare module jasmine {
interface Matchers {
toBeNumeric(): void;
}
}
Another article gives a similar but slightly different solution that gives the same error.
declare namespace jasmine {
interface Matchers {
toHaveText(expected: string): boolean;
}
}
I tried this
let m: jasmine.Matchers = expect(someSpy.someMethod).toHaveBeenCalled();
and got this error:
Enter "jasmine.Matchers" is not assigned to the type "jasmine.Matchers". There are two different types with this name, but they are not related.
, declare namespace jasmine
jasmine
.
, , typescript ?