-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Note that we don't call await on each tween:
Lines 59 to 62 in 7a733f2
| // Call each tween | |
| tweens.forEach(tween => { | |
| tween(requestDetails, req, res); | |
| }); |
This is deliberate - so that code can execute "after" a request (the whole point of tweenz). Putting await here would create an infinite promise loop.
This behaviour is mostly ok, except when you want to run tests on tweenz. Code can run after the test completes :)
This can be worked around by using something like https://www.npmjs.com/package/flush-promises a bunch of times before writing any assertions.
The 'proper' fix may be some global function that can be used in tests to properly await the results of tweens
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels