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'是服務還是組件?你是否靜態調用? –