-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use promises instead of callbacks (#125)
The `flush()` method and the `report(series)` method on reporters now use promises instead of callbacks, moving to a more standardized model for async operations. The old callbacks are still supported, but deprecated, and will be removed in the future. Fixes #84. Other items to note here: - The global error handler now *always* runs for errors (it used to only run if there was no error callback for `flush`). This is probably how it always should have been, and fits better with the promise model. - The promise returned from `flush()` is a little special — it won’t throw an async error if you don’t handle errors, so it’s safe to simply call and not use `await` or a `.catch()` handler (unlike normal async functions). - Moved HTTP-related tests to a new reporters suite; the logger tests now use a mock reporter. - Bumps version to v0.12.0-dev since this is a major feature.
- Loading branch information
Showing
7 changed files
with
358 additions
and
200 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,9 @@ | |
"files": ["test/**/*.js"], | ||
"env": { | ||
"mocha": true | ||
}, | ||
"rules": { | ||
"max-statements": ["off"] | ||
} | ||
} | ||
] | ||
|
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
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
Oops, something went wrong.