From ce1447920efe74c93418646b2834fc9bd852c351 Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Thu, 8 Mar 2018 18:17:46 -0500 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/19245 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson --- test/addons-napi/test_promise/test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/addons-napi/test_promise/test.js b/test/addons-napi/test_promise/test.js index 6dc51b3fa558a2..477ceb75969d51 100644 --- a/test/addons-napi/test_promise/test.js +++ b/test/addons-napi/test_promise/test.js @@ -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;