-
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
step API #1075
Comments
I did a quick prototype here: 3e515c3 |
I like this (and think there are several use cases within our own test suite for it), but seems like it is missing one thing: asserting that the correct steps happened. Seems like maybe we need |
That's a great and useful addition to the step api. I like it. |
Introduces the assert.step function which logs a passing assertion for steps in a test. These steps are stored as string values to help verify order of operations. Fixes qunitjs#1075
Introduces the assert.verifySteps function to complement assert.step. This acceptances an array of string values to compare to the steps that have executed for the current test. Fixes qunitjs#1075
Introduces the assert.step function which logs a passing assertion for steps in a test. These steps are stored as string values to help verify order of operations. Fixes qunitjs#1075
Introduces the assert.verifySteps function to complement assert.step. This acceptances an array of string values to compare to the steps that have executed for the current test. Fixes qunitjs#1075
I'm not opposed to this landing, but I am not sure I understand the use case fully. I see the example above, but I'm not sure I fully understand what advantage this has over |
Improves readability and it's also motivated by occurrence. Afaik, this case was frequent in some async jquery tests and will certainly gonna be used by Ember as this is an original request from Yehuda Katz. |
Introduces the assert.verifySteps function to complement assert.step. This acceptances an array of string values to compare to the steps that have executed for the current test. Fixes #1075
@leobalter Thanks for the explanation, that works for me. That said, I'd love to see a longer-form case study for steps and step verification show up in the QUnit Cookbook maybe (unless that was covered in the documentation PRs?). If that seems worthwhile, I can create an issue. |
it is! Using async code is one of the nice ways to use for examples. Async fns and promises will be great for that. |
@wycatz suggested this step API and I'm game for it.
It records steps inside a test. Given this example:
Each step can be recorded as a
assert.ok(true)
, but printing the given description.There's one con to consider for this API, which is the idea that assertions can be split in different tests specially inside nested modules.
Even though, it is an interesting approach to consider.
The text was updated successfully, but these errors were encountered: