ts-node src/run2.ts
true
in test1 ...
in test2 ...
(node:13530) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Uncaught, unspecified "error" event. ([object Object])
(node:13530) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
When async function throw
Error
, process terminated with node errors. was expecting it will settle and error will be available in callback.Output