node/test/addons/callback-scope/test-resolve-async.js
Anna Henningsen bdaa2cb585
test: add regression test for 5691
With `CallbackScope`, this has become possible to do properly.

Fixes: https://github.com/nodejs/node/issues/5691
PR-URL: https://github.com/nodejs/node/pull/14697
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-14 17:38:45 +02:00

14 lines
353 B
JavaScript

'use strict';
const common = require('../../common');
const assert = require('assert');
const { testResolveAsync } = require(`./build/${common.buildType}/binding`);
let called = false;
testResolveAsync().then(common.mustCall(() => {
called = true;
}));
setTimeout(common.mustCall(() => { assert(called); }),
common.platformTimeout(20));