diff --git a/test/parallel/test-domain-stack-empty-in-process-uncaughtexception.js b/test/parallel/test-domain-stack-empty-in-process-uncaughtexception.js index 79ded2dd9d1424..e9e8ab12d59d2c 100644 --- a/test/parallel/test-domain-stack-empty-in-process-uncaughtexception.js +++ b/test/parallel/test-domain-stack-empty-in-process-uncaughtexception.js @@ -6,15 +6,18 @@ const assert = require('assert'); const d = domain.create(); -process.on('uncaughtException', common.mustCall(function onUncaught() { +process.once('uncaughtException', common.mustCall(function onUncaught() { assert.strictEqual( process.domain, null, - 'domains stack should be empty in uncaughtException handler'); + 'Domains stack should be empty in uncaughtException handler ' + + `but the value of process.domain is ${JSON.stringify(process.domain)}`); })); process.on('beforeExit', common.mustCall(function onBeforeExit() { - assert.strictEqual(process.domain, null, - 'domains stack should be empty in beforeExit handler'); + assert.strictEqual( + process.domain, null, + 'Domains stack should be empty in beforeExit handler ' + + `but the value of process.domain is ${JSON.stringify(process.domain)}`); })); d.run(function() {