diff --git a/test/addons/callback-scope/test-resolve-async.js b/test/addons/callback-scope/test-resolve-async.js index 98e1910b49df7b..c2942397737359 100644 --- a/test/addons/callback-scope/test-resolve-async.js +++ b/test/addons/callback-scope/test-resolve-async.js @@ -4,7 +4,9 @@ const common = require('../../common'); const assert = require('assert'); const { testResolveAsync } = require(`./build/${common.buildType}/binding`); +// Checks that resolving promises from C++ works. + let called = false; testResolveAsync().then(() => { called = true; }); -setTimeout(() => { assert(called); }, common.platformTimeout(50)); +process.on('beforeExit', () => { assert(called); });