avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.74k stars 1.41k forks source link

Passing t.assert() does not count as a passed assertion #2354

Closed novemberborn closed 4 years ago

novemberborn commented 4 years ago

This is a regression in the upcoming v3 release.

The t.assert() implementation without power-assert in broken:

https://github.com/avajs/ava/blob/090884b5040a1d4b02a18939245f7c2305228e00/lib/assert.js#L856

After calling fail() we need to return. Then outside of that if-condition, we need to call pass().

See https://github.com/avajs/ava/blob/090884b5040a1d4b02a18939245f7c2305228e00/lib/assert.js#L837:L840 for an example.

Our tests don't cover this but that'll be a lot harder to address.

theashraf commented 4 years ago

I'd like to help with this one

novemberborn commented 4 years ago

@theashraf awesome!

The change should be straight-forward. If you don't mind though — I might have time to do some AVA work this weekend so if you haven't gotten to it yet I may fix this then so I can publish another beta.