Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHave assertions return booleans #2455
Comments
Hello, can i work on this ? |
@aviralch yea that'd be great, thanks! |
Hi, @novemberborn I am also attempting an update to this issue and wondering if I could be assigned to it too? Not sure if that is allowed, but I would like to work on this also. Thanks |
@pmascheroni let's give @aviralch a chance first. |
@novemberborn, @pmascheroni this is my first issue, I will try to do this and keep you updated by the end of of week. |
Hi, if no one is currently working on this and it is still open, i would like to contribute. |
@aviralch what do you think? |
Yup, sure go ahead. I am currently in middle of exams but if you need to get in touch lmk. |
Thank you @aviralch, and good luck! |
Hi, is it done ?, if not I can make a try ! Please let me know |
Hi @RahulKannan12, I am currently working on it. |
Hi @BARICISSE , Okay great ! thanks for the information |
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 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.