Spurred by conversation in #2449 and #1485 we'd like for our assertions to return booleans. true when they pass, false when they fail. This does not apply to the throws() and throwsAsync() assertions.
Failing assertions will fail the test, but do not throw exceptions. This means your test does not stop executing. Usually that's fine, but there are conditions where you're about to do something that uses a lot of resources, and it's already unnecessary. Returning booleans will help with this.
The assertions are defined here:
The type definition should be updated to reflect the new return type:
|
export interface Assertions { |
Some tests should be added to (or existing test updated in) https://github.com/avajs/ava/blob/master/test-tap/assert.js.
Spurred by conversation in #2449 and #1485 we'd like for our assertions to return booleans.
truewhen they pass,falsewhen they fail. This does not apply to thethrows()andthrowsAsync()assertions.Failing assertions will fail the test, but do not throw exceptions. This means your test does not stop executing. Usually that's fine, but there are conditions where you're about to do something that uses a lot of resources, and it's already unnecessary. Returning booleans will help with this.
The assertions are defined here:
ava/lib/assert.js
Line 238 in 18aeac6
The type definition should be updated to reflect the new return type:
ava/index.d.ts
Line 41 in 18aeac6
Some tests should be added to (or existing test updated in) https://github.com/avajs/ava/blob/master/test-tap/assert.js.