From 90bba9fd3e17819bd08f8d2a4008b64272901227 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 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 b40b15ad030c89..bce83cab20eb17 100644 --- a/test/README.md +++ b/test/README.md @@ -186,6 +186,13 @@ doesn't have privileges to create symlinks (specifically [SeCreateSymbolicLinkPrivilege](https://msdn.microsoft.com/en-us/library/windows/desktop/bb530716(v=vs.85).aspx)). On non-Windows platforms, this currently returns true. +### 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)