Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have assertions return booleans #2455

Closed
novemberborn opened this issue Apr 14, 2020 · 27 comments
Closed

Have assertions return booleans #2455

novemberborn opened this issue Apr 14, 2020 · 27 comments

Comments

@novemberborn
Copy link
Member

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:

class Assertions {

The type definition should be updated to reflect the new return type:

ava/index.d.ts

Line 41 in 18aeac6

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.

@aviralch
Copy link

Hello,

can i work on this ?

@novemberborn
Copy link
Member Author

@aviralch yea that'd be great, thanks!

@pmascheroni
Copy link

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

@novemberborn
Copy link
Member Author

@pmascheroni let's give @aviralch a chance first.

@aviralch
Copy link

@novemberborn, @pmascheroni this is my first issue, I will try to do this and keep you updated by the end of of week.

@BARICISSE
Copy link

Hi, if no one is currently working on this and it is still open, i would like to contribute.

@novemberborn
Copy link
Member Author

@aviralch what do you think?

@aviralch
Copy link

Yup, sure go ahead. I am currently in middle of exams but if you need to get in touch lmk.

@novemberborn
Copy link
Member Author

Thank you @aviralch, and good luck!

@RahulKannan12
Copy link

Hi, is it done ?, if not I can make a try ! Please let me know 👍 I would like to contribute

@BARICISSE
Copy link

Hi @RahulKannan12, I am currently working on it.

@RahulKannan12
Copy link

Hi @BARICISSE , Okay great ! thanks for the information 👍

@HungryPandaBytes
Copy link

HungryPandaBytes commented Jul 16, 2020

Hello is this ticket still open? If not, I would like to grab this!

@novemberborn
Copy link
Member Author

@mzzlillieee yes go for it.

@jmarkham828
Copy link
Contributor

@mzzlillieee @novemberborn Hey yo! :) I have a draft PR for this issue that I believe is almost there. @novemberborn need a little guidance on how to update the test file -- this is my first issue. Would you mind if I pushed up what I had if @mzzlillieee is busy?

@HungryPandaBytes
Copy link

@jmarkham828 No I don't mind. Something came up, so I won't be able to work on this issue until next week.

@jmarkham828
Copy link
Contributor

@mzzlillieee awesome! @novemberborn would you mind adding me to this issue so I can push?

@novemberborn
Copy link
Member Author

would you mind adding me to this issue so I can push?

@jmarkham828 sure, but you don't need to be assigned an issue to create a PR 😉

@rShar01
Copy link

rShar01 commented Aug 6, 2020

Does this issue still a contributer?

@novemberborn
Copy link
Member Author

@rShar01 this was picked up by @jmarkham828 quite recently, so maybe check in with them.

@jmarkham828
Copy link
Contributor

Will work on this PR #2564 more this weekend -- took me a while to tie up some projects at work, but am free to work Saturday and Sunday! Like I said, @novemberborn, I wasn't quite sure how to update the test file, what do you think?

@adiSuper94
Copy link
Contributor

@novemberborn , I'd like to take a crack at this issue. If @jmarkham828 is no longer active.

@novemberborn
Copy link
Member Author

@adiSuper94 both you and @Davidmh93 have expressed an interest. And we haven't yet heard back from @jmarkham828 but that's OK. I think if either of you could take their commits and add on top of them, based on my feedback in #2564 that'd be great. And then you could help each other as well if need be. Does that sound all right?

@dmanit
Copy link

dmanit commented Sep 18, 2020

I'm unable to pick this one up now sorry

@shailenpatel1
Copy link

Can I work on this?

@novemberborn
Copy link
Member Author

@shailenpatel1 maybe you could pick up where #2586 left off?

@novemberborn
Copy link
Member Author

Merged in #2696.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.