-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly handle test aborts when awaiting promises
Fix #583 Add an 'abort' method to the Waiter class in lib/test.js. This lets us effectively bail out of a promise when `t.endAll()` is called. Previously, using bailouts in the presence of t.resolves, t.rejects, t.resolveMatch, or t.resolveMatchSnapshot would throw a TypeError, because the endAll method expected this.occupied to be a Test object. However, as of 63f9c92, `this.occupied` is set to a Waiter object instead, to avoid an extra layer of indentation for promise-handling assertions.
- Loading branch information
Showing
3 changed files
with
206 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I don't love this "trailing boolean" API surface, but at least it's an internal method. Probably
waitOn
should be aSymbol
to keep it private?