From dfcefd6276678ca214d3cd88cdaf49ccdedcff65 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 27 Apr 2017 18:09:57 +0200 Subject: [PATCH] test,doc: document `crashOnUnhandledRejection()` Add documentation for `common.crashOnUnhandledRejection()`. Ref: https://github.com/nodejs/node/pull/12489/files/a9c2078a60bc3012dc6156df19772697a56a2517#r113737423 PR-URL: https://github.com/nodejs/node/pull/12699 Backport-PR-URL: https://github.com/nodejs/node/pull/13103 Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Santiago Gimeno Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Yuta Hiroto Reviewed-By: Michael Dawson Reviewed-By: Gibson Fahnestock --- test/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/README.md b/test/README.md index 381402770c8621..a97e5f222b4627 100644 --- a/test/README.md +++ b/test/README.md @@ -174,6 +174,13 @@ A stream to push an array into a REPL Blocks for `time` amount of time. +### crashOnUnhandledRejection() + +Installs a `process.on('unhandledRejection')` handler that crashes the process +after a tick. This is useful for tests that use Promises and need to make sure +no unexpected rejections occur, because currently they result in silent +failures. + ### ddCommand(filename, kilobytes) * return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)