【发布时间】:2019-12-26 04:57:39
【问题描述】:
我的规范中有以下测试用例,
it (should create,()=>{
const url = (<jasmine.spy> http.get).calls.args(0)[0]
expect(url).toBe('/api/get')
});
当我运行它时,我收到以下 lint 错误。
Type assertion using the '<>' is forbidden, use as instead?
任何人都可以提供帮助。
【问题讨论】:
-
http.get as jasmine.spy是它想要你做的——就去做吧?
标签: angular typescript jasmine karma-jasmine angular-unit-test