Skip to content

Commit

Permalink
n-api: resolve promise in test
Browse files Browse the repository at this point in the history
The last promise created by the test for the purposes of making sure
that its type is indeed a promise needs to be resolved so as to avoid
having it left in the pending state at the end of the test.

PR-URL: #19245
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
Gabriel Schulhof committed Mar 12, 2018
1 parent 0048169 commit 33e63fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/addons-napi/test_promise/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ common.crashOnUnhandledRejection();
test_promise.concludeCurrentPromise(Promise.resolve('chained answer'), true);
}

assert.strictEqual(test_promise.isPromise(test_promise.createPromise()), true);
const promiseTypeTestPromise = test_promise.createPromise();
assert.strictEqual(test_promise.isPromise(promiseTypeTestPromise), true);
test_promise.concludeCurrentPromise(undefined, true);

const rejectPromise = Promise.reject(-1);
const expected_reason = -1;
Expand Down

0 comments on commit 33e63fe

Please sign in to comment.