Skip to content
This repository has been archived by the owner on Sep 17, 2022. It is now read-only.

Commit

Permalink
test_node: throw on unhandled promise rejections (#118)
Browse files Browse the repository at this point in the history
This makes 'test' script treat unhandled rejections as errors.

Refs: tensorflow/tfjs-core#1152
Refs: https://nodejs.org/api/process.html#process_event_unhandledrejection

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/tensorflow/tfjs-node/118)
<!-- Reviewable:end -->
  • Loading branch information
ChALkeR authored and nkreeger committed Jul 10, 2018
1 parent b706b2d commit 844c490
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/run_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: () =>
Expand Down

0 comments on commit 844c490

Please sign in to comment.