Following up #472 (comment)
Suggest to add the two assertions (or something similar) from tape-promise https://github.com/jprichardson/tape-promise#new-assertions
It would not change the existing behaviour, as the two assertions are async.
Example from tape-promise:
test('reject and doesNotReject example', async (t) => {
await t.rejects(asyncFunction)
await t.rejects(asyncFunction())
await t.doesNotReject(Promise.resolve())
})
The await is on the assertion, not on the input of the assertion. It reads "The input promise will eventually reject".
Right now I am using following code to migrate from tape-promise to tape v5.
test('...', async t => {
try {
await something();
t.fail('should not pass');
} catch (err) {
t.ok(err instanceof SomeErrorType);
}
});
Following up #472 (comment)
Suggest to add the two assertions (or something similar) from tape-promise https://github.com/jprichardson/tape-promise#new-assertions
It would not change the existing behaviour, as the two assertions are async.
Example from tape-promise:
The
awaitis on the assertion, not on the input of the assertion. It reads "The input promise will eventually reject".Right now I am using following code to migrate from tape-promise to tape v5.