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
{{ message }}
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
The assertRevert function uses chai assertions, and does not block test success until the promise resolves, forcing the user to add a delay after the assertion.
The following expectRevert blocks jest tests until the promise returned by fn resolves, which is far superior:
async function expectRevert(fn, msg) {
expect.assertions(1);
await expect(fn()).rejects.toThrowError(msg);
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Related: magmo/apps#162
The
assertRevert
function uses chai assertions, and does not block test success until the promise resolves, forcing the user to add a delay after the assertion.The following
expectRevert
blocks jest tests until the promise returned byfn
resolves, which is far superior:The text was updated successfully, but these errors were encountered: