In the most recent change to the Jasmine types, the behavior of SpyObj has removed the ability for me to Spy on some classes.
Example: I am spying on MatExpansionPanel from @angular/material/expansion/typings/expansion-panel.
I am creating the Spy with:
let matExpansionPanelMock: jasmine.SpyObj<MatExpansionPanel>;
matExpansionPanelMock = jasmine.createSpyObj<MatExpansionPanel>('MatExpansionPanel', ['_getExpandedState', 'open', 'close']);
However, when I try to do anything with the matExpansionPanelMock, I am left with the error:
TS2345: Argument聽of聽type聽'SpyObj<MatExpansionPanel>'聽is聽not聽assignable聽to聽parameter聽of聽type聽'MatExpansionPanel'. 聽聽Property聽'_viewContainerRef'聽is聽missing聽in聽type聽'SpyObj<MatExpansionPanel>'.
This only showed up after [@types/jasmine] was updated from 3.3.3 -> 3.3.4. I believe these are the changes that are causing my issue, but I'm unsure if it's a bug or a new convention.
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/d89ab9a678475a2aa97041ee5c33fb8997efcb74#diff-9e4053693e748b8ffdb3e9eb9d9299e8
@types/jasmine package and had problems.Definitions by: in index.d.ts) so they can respond.If you do not mention the authors the issue will be ignored.
The fix is on it's way
Most helpful comment
The fix is on it's way