Skip to content

Commit faf94b1

Browse files
Gabriel SchulhofMylesBorins
Gabriel Schulhof
authored andcommitted
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. 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>
1 parent df63adf commit faf94b1

File tree

1 file changed

+3
-1
lines changed
  • test/addons-napi/test_promise

1 file changed

+3
-1
lines changed

test/addons-napi/test_promise/test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ common.crashOnUnhandledRejection();
4545
test_promise.concludeCurrentPromise(Promise.resolve('chained answer'), true);
4646
}
4747

48-
assert.strictEqual(test_promise.isPromise(test_promise.createPromise()), true);
48+
const promiseTypeTestPromise = test_promise.createPromise();
49+
assert.strictEqual(test_promise.isPromise(promiseTypeTestPromise), true);
50+
test_promise.concludeCurrentPromise(undefined, true);
4951

5052
const rejectPromise = Promise.reject(-1);
5153
const expected_reason = -1;

0 commit comments

Comments
 (0)