power-assert-js/power-assert

Duplication in the error's stack and message

rstacruz opened this issue · 7 comments

In mocha, the power-assert messages are displayed on both the stack and the message... it's a bit redundant.

pasted_image_4_26_15__2_27_pm

@rstacruz Thank you for reporting!

In mocha, the power-assert messages are displayed on both the stack and the message... it's a bit redundant.

I think so too. This problem should be fixed ASAP.

Duplication appears since mocha 2.2.3, maybe since this commit.

I'll isolate the problem to determine which is wrong (power-assert or mocha), then fix or PR it soon.

Thanks!

Ah this problem is due to this change (Shorten stack traces). Filepath is shortened to relative path to the deploy folder, on the other hand Assertion message created by power-assert is absolute filepath. So first line in stack and assertion message does not match, stack is preserved, duplication appears.

I'll try to store relative paths in power-assert message.

heh, considering that feature came from my work, i guess indirectly I caused that ;)

twada commented

This issue is fixed by the 1.0.0 release.
Feel free to reopen this if it is not fixed.

congrats on the 1.0 release!

twada commented

@rstacruz Thanks! :)