feat: add support for generator functions in specs #5166
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2666
Easy enough to do, and brings some more feature parity with ava (https://github.com/avajs/ava/blob/965cbc65d82b12019cdf6a3257b3198dd4181b79/readme.md#generator-function-support).
Also, I was bored, and this was the lowest hanging fruit I could find with some people behind it :P I didn't update the docs much as
async-await
is to be preferred. Can point it out if we want it, though.(Feel free to close this if you really don't want it, but I don't see the harm, tbh (6 lines of code))
Test plan
Integration test added. I didn't see any unit tests for the promisification happening to
it
already.