n-api: resolve promise in test

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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Gabriel Schulhof 2018-03-08 18:17:46 -05:00
parent 0048169f5e
commit 33e63fe64f

View File

@ -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;