From 844c490516e9451bd58c87a02bc67d4269ee202e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Tue, 10 Jul 2018 23:56:15 +0300 Subject: [PATCH] test_node: throw on unhandled promise rejections (#118) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes 'test' script treat unhandled rejections as errors. Refs: /~https://github.com/tensorflow/tfjs-core/pull/1152 Refs: https://nodejs.org/api/process.html#process_event_unhandledrejection --- This change is [Reviewable](https://reviewable.io/reviews/tensorflow/tfjs-node/118) --- src/run_tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/run_tests.ts b/src/run_tests.ts index cfcfd5af..2591cca3 100644 --- a/src/run_tests.ts +++ b/src/run_tests.ts @@ -28,6 +28,8 @@ import bindings = require('bindings'); import {TFJSBinding} from './tfjs_binding'; import {NodeJSKernelBackend} from './nodejs_kernel_backend'; +process.on('unhandledRejection', e => { throw e; }); + jasmine_util.setTestEnvs([{ name: 'test-tensorflow', factory: () =>