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.

Backport-PR-URL: #19265
PR-URL: #19245
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
Gabriel Schulhof authored and MylesBorins committed May 1, 2018
1 parent df63adf commit faf94b1
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 faf94b1

Please sign in to comment.