You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have discussed this before in #94. As per that discussion, it's a little tricky to pull off because the logic of what an "assertion" is with Chai's fluent syntax is very different to simpler test frameworks like that of Ava, Tape, Tap, Qunit et al.
Having said that, #94 is still open so we can come to a consensus, so feel free to continue the discussion there.
It might be useful to have assertion planning built into chai for async testing (see e.g. avajs/ava#25).
I currently imagine it working roughly like this:
chai.plan(n)
sets an internalassertionsPlanned
variable ton
and resetsassertionsExecuted
to0
expect(...)
call increments theassertionsExecuted
countershould
interface we should increment in theAssertion
constructor if aplanned
flag hasn't been set yetchai.verifyPlan()
comparedassertionsPlanned
withassertionsExecuted
and throws an error if they don't matchchai.verifyPlan()
should also resetassertionsPlanned
to0
to make it work for following tests that don't usechai.plan(n)
The text was updated successfully, but these errors were encountered: