Skip to content

Commit b483675

Browse files
addaleaxgibfahn
authored andcommitted
test,doc: document crashOnUnhandledRejection()
Add documentation for `common.crashOnUnhandledRejection()`. Ref: https://github.com/nodejs/node/pull/12489/files/a9c2078a60bc3012dc6156df19772697a56a2517#r113737423 PR-URL: #12699 Backport-PR-URL: #13103 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent 0a3b59b commit b483675

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,13 @@ A stream to push an array into a REPL
174174

175175
Blocks for `time` amount of time.
176176

177+
### crashOnUnhandledRejection()
178+
179+
Installs a `process.on('unhandledRejection')` handler that crashes the process
180+
after a tick. This is useful for tests that use Promises and need to make sure
181+
no unexpected rejections occur, because currently they result in silent
182+
failures.
183+
177184
### ddCommand(filename, kilobytes)
178185
* return [&lt;Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
179186

0 commit comments

Comments
 (0)