avajs/eslint-plugin-ava










Do you want to work on this issue?
You can request for a bounty in order to promote it!
Rule proposal: `prefer-t-throws` #156
gajus posted onGitHub
I was reviewing some codes using ava and found this pattern repeating often:
try {
await request(requestOptions);
} catch (error) {
t.true(error.statusCode === 500);
}
This can be written instead as:
const error = await t.throws(request(requestOptions));
t.true(error.statusCode === 500);
I think the latter should be preferred.
Fund this Issue
Only logged in users can fund an issue
Pull requests
Add `prefer-t-throws` rule #345submitted bymesteery(68)
Recent activities