-
Notifications
You must be signed in to change notification settings - Fork 783
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
[QUESTION] is it possible to fail a test in the QUnit.testDone callback? #817
Comments
That's an interesting usecase, though one that the logging callbacks like |
This will be in every module and so it is not desirable to put this into each |
Assuming you abstract the necessary logic, you'd add 3-4 LOC per module. Also assuming one module per file, a reader of that file could quickly figure out where that shared setup is defined, compared to having it in just one place somewhere else. That said, we've had a discussion about that feature before, even implemented it at some point, but dropped it before release. I can't remember that name of the ticket right now, but can look for it later... |
Correct me if I'm wrong but even in the |
So the answer to the question in the subject, can a The attempt to implement global beforeEach/afterEach callbacks can be found in #633, while #681 discusses why we ended up removing them again. As I wrote there:
That's still a discussion we can have, though since this issue isn't about that, I'm going to close this for now. |
In the QUnit 2.0 series, the
assert
is no longer global (good thing!) and is passed into each test's callback. When I made this upgrade, my testDone callback is no longer failing tests like it had been (because I had been using the global assert). I had some code that would check to see that all requests were properly mocked and if there were too many or too few mocks, I would fail the test. I see my error messages but doing aQUnit.assert.ok(false, "error message")
has no effect on the test. Can someone please advise how I would be able to fail the test that just run from inside the testDone callback?Thanks!
The text was updated successfully, but these errors were encountered: