diff --git a/test/parallel/test-domain-safe-exit.js b/test/parallel/test-domain-safe-exit.js index bbc3b2fe22cae8..bf8b9faaa424ce 100644 --- a/test/parallel/test-domain-safe-exit.js +++ b/test/parallel/test-domain-safe-exit.js @@ -1,16 +1,19 @@ 'use strict'; +require('../common'); // Make sure the domain stack doesn't get clobbered by un-matched .exit() -require('../common'); const assert = require('assert'); const domain = require('domain'); +const util = require('util'); const a = domain.create(); const b = domain.create(); a.enter(); // push b.enter(); // push -assert.deepStrictEqual(domain._stack, [a, b], 'b not pushed'); +assert.deepStrictEqual(domain._stack, [a, b], 'Unexpected stack shape ' + + `(domain._stack = ${util.inspect(domain._stack)})`); domain.create().exit(); // no-op -assert.deepStrictEqual(domain._stack, [a, b], 'stack mangled!'); +assert.deepStrictEqual(domain._stack, [a, b], 'Unexpected stack shape ' + + `(domain._stack = ${util.inspect(domain._stack)})`);