我有以下异步函数返回的承诺。
static getAccessToken(env: DeploymentEnv, username: string, password: string): Promise<AccessToken>;
现在,我写了这本单元测试。
it("should be able to get access token",async ()=>{
let accessToken = await IModelHubServiceBusClient.getAccessToken('QA',
'abc@xyz.com',
'abc')!;
assert.exists(accessToken);
});
当运行它,它未能通过测试说出以下错误:
should be able to get access token:
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
我在做什么错了,任何建议将不胜感激。 提前致谢。