0
Example.ts无法定位spec文件
export class Example{
public async initService(Id): Promise<any> {
//promise logic
}
}
Example.spec.ts
//imported Example class correctly
describe('testing', async() =>{
it('InitService test call', async()=>{
let x = await Example.initService(id:any) //this line displays error as initService does not exist on type 'typeof AnnounceService'
});
});
我已经正确导入的类例的功能,但随后也无法调用的功能示例类中的示例.spec.ts。
是'Example'是服务还是组件?你是否静态调用? –