【发布时间】:2020-06-22 11:54:22
【问题描述】:
以下代码升级到“@types/jasmine”后抛出错误:“^3.4.0”
spyOn(document, 'getElementById').and.callFake(function() {
return {
value: 'test'
};
});
错误是:
Argument of type '() => { value: string; }' is not assignable to parameter of type '(elementId: string) => HTMLElement'.
Type '{ value: string; }' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 233 more.
【问题讨论】:
标签: angular typescript jasmine karma-jasmine angular-upgrade