You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to compose power-assert + espower in vanilla node 7 or 8 #85
/Users/azu/.ghq/github.com/TehShrike/power-assert-espower-repro/assert-error.js:7
throw e;
^
AssertionError: custom message
at Object.<anonymous> (/Users/azu/.ghq/github.com/TehShrike/power-assert-espower-repro/assert-error.js:4:5)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
Node.js 7
/Users/azu/.ghq/github.com/TehShrike/power-assert-espower-repro/assert-error.js:7
throw e;
^
AssertionError: false == true
at Object.<anonymous> (/Users/azu/.ghq/github.com/TehShrike/power-assert-espower-repro/assert-error.js:4:5)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3
/Users/azu/.ghq/github.com/TehShrike/power-assert-espower-repro/assert-error.js:7
throw e;
^
AssertionError [ERR_ASSERTION]: false == true
at Object.<anonymous> (/Users/azu/.ghq/github.com/TehShrike/power-assert-espower-repro/assert-error.js:4:5)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3
Actually, empower does e.message = buildPowerAssertText(formatter, errorEvent.originalMessage, errorEvent.powerAssertContext);.
✈ node assert-error.js
/Users/azu/.ghq/github.com/TehShrike/power-assert-espower-repro/assert-error.js:7
throw e;
^
Error: custom message
at Object.<anonymous> (/Users/azu/.ghq/github.com/TehShrike/power-assert-espower-repro/assert-error.js:4:11)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3
changed the title [-]Unable to compose power-assert + espower in node 7[/-][+]Unable to compose power-assert + espower in node 7 or 8[/+]on Jun 2, 2017
changed the title [-]Unable to compose power-assert + espower in node 7 or 8[/-][+]Unable to compose power-assert + espower in vanilla node 7 or 8[/+]on Jun 8, 2017
Activity
twada commentedon May 21, 2017
@TehShrike Thank you for reporting and creating repro case!
I confirmed that vanilla assertions under Node v6 produces pretty output but Node v7 doesn't (but Node v7 + mocha produces pretty output as well).
I'll investigate this issue a bit deeper.
TehShrike commentedon May 21, 2017
Awesome, thank you so much.
[-]Unable to compose power-assert + espower in node[/-][+]Unable to compose power-assert + espower in node 7[/+]TehShrike commentedon Jun 1, 2017
Looks like node 8 behaves the same as node 7.
twada commentedon Jun 1, 2017
@TehShrike Thank you for the information. I'm bit busy this week but still investigating...
azu commentedon Jun 1, 2017
I've figured out this.
Node.js 6
Node.js 7
Node.js 8:
(Error code is added: nodejs/node#12651)
Actually, empower does
e.message = buildPowerAssertText(formatter, errorEvent.originalMessage, errorEvent.powerAssertContext);.But, Node.js 7~ does not show this
e.messageof throwing AssertionError.I think that Node.js 7~ treat
AssertionErroras special object.Node 8 work fine.
azu commentedon Jun 1, 2017
This change is introduced by nodejs/node#11273
[-]Unable to compose power-assert + espower in node 7[/-][+]Unable to compose power-assert + espower in node 7 or 8[/+]fix: recreate AssertionError under Node v8 if message is modified
[-]Unable to compose power-assert + espower in node 7 or 8[/-][+]Unable to compose power-assert + espower in vanilla node 7 or 8[/+]fix: recreate AssertionError under Node v8,v7 and if message is modified
TehShrike commentedon Jun 9, 2017
After updating the dependencies in my power-assert-espower-repro repository (and removing the duplicate log/throw), this is the output using node 8:
twada commentedon Jun 9, 2017
@TehShrike Yeah we did it! Thank you for reporting again.
twada commentedon Jun 14, 2017
This issue is fixed by power-assert 1.4.4
docs(README): add `power-assert message does not appear in Node8`