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

Do assertions dependant on call order #200

Closed

Conversation

kevinawoo
Copy link
Contributor

This should resolve issues like #173 and #197 by letting the user determine which error should bubble up first.

Also added tests to validate ordering.

@mikelax
Copy link
Contributor

mikelax commented May 26, 2015

@kevinawoo do you want to update this PR to resolve the conflicts? This would be nice to include in the next minor release.

@kevinawoo kevinawoo force-pushed the feature/assertion-call-order branch 2 times, most recently from 3b19795 to 19f75e6 Compare May 27, 2015 09:36
@kevinawoo
Copy link
Contributor Author

@mikelax sorry it took so long. All good to go.

@Rob--W
Copy link
Contributor

Rob--W commented May 30, 2015

You've introduced a stack of expectations to track order, while the separate arrays for bodies, (header) fields and status code are still kept. But the addition of the stack makes these arrays obsolete, so it's better to not confuse the reader and remove them.

Due to the size of the Test.prototype.assert function, it was not straightforward to reason about the correctness of the implementation. Therefore I submitted a new PR (#239) that fixes this issue and adds the feature (among a few others enhancements like this/res not being set and a superfluous instanceof Error check). I have cherry-picked your tests, because these appeared OK.

@kevinawoo
Copy link
Contributor Author

Closed in favor of #239

@kevinawoo kevinawoo closed this May 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants