MCPcopy Create free account
hub / github.com/nodejs/node / testPromise

Function testPromise

test/async-hooks/test-destroy-not-blocked.js:61–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61function testPromise() {
62 assert.strictEqual(activeId, -1);
63 const res = new AsyncResource(resType);
64 assert.strictEqual(activeId, res.asyncId());
65 res.emitDestroy();
66 // Promise has higher prio than emit destroy
67 Promise.resolve().then(common.mustCall(() => {
68 assert.strictEqual(activeId, res.asyncId());
69 }));
70}
71
72async function testAwait() {
73 assert.strictEqual(activeId, -1);

Callers

nothing calls this directly

Calls 4

asyncIdMethod · 0.95
emitDestroyMethod · 0.95
thenMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected