Open
Description
The error occures when i try to test error case for async method.
So i have
it("service should catch exception when it is raised", async() => {
const error = new Error();
sandbox.stub(Service, "method").withArgs(arg1, arg2 ).rejects(error);//this method is called in Api.serviceMethod, it is async too
await expect(Api.serviceMethod(arg1, arg2)).to.be.rejectedWith(error);
if instead of async/await i use just
return expect(Api.serviceMethod(arg1, arg2)).to.be.rejectedWith(error);
it works properly
Metadata
Metadata
Assignees
Labels
No labels