mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
ee31c28298
In short: Some unit tests are using string literals to simply tell you a conclusion what's right/wrong BUT not tell you what actually values are. So it's necessary to print them out in the console. Refs: https://github.com/nodejs/node/pull/22849 PR-URL: https://github.com/nodejs/node/pull/22891 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
29 lines
756 B
JavaScript
29 lines
756 B
JavaScript
'use strict';
|
|
require('../common');
|
|
|
|
const assert = require('assert');
|
|
const async_hooks = require('async_hooks');
|
|
const triggerAsyncId = async_hooks.triggerAsyncId;
|
|
|
|
const triggerAsyncId0 = triggerAsyncId();
|
|
let triggerAsyncId1;
|
|
|
|
process.nextTick(() => {
|
|
process.nextTick(() => {
|
|
triggerAsyncId1 = triggerAsyncId();
|
|
// Async resources having different causal ancestry
|
|
// should have different triggerAsyncIds
|
|
assert.notStrictEqual(
|
|
triggerAsyncId0,
|
|
triggerAsyncId1);
|
|
});
|
|
process.nextTick(() => {
|
|
const triggerAsyncId2 = triggerAsyncId();
|
|
// Async resources having the same causal ancestry
|
|
// should have the same triggerAsyncId
|
|
assert.strictEqual(
|
|
triggerAsyncId1,
|
|
triggerAsyncId2);
|
|
});
|
|
});
|