You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
The error occures when i try to test error case for async method.
So i have
if instead of async/await i use just
return expect(Api.serviceMethod(arg1, arg2)).to.be.rejectedWith(error);
it works properly
The text was updated successfully, but these errors were encountered: