-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to compose power-assert + espower in vanilla node 7 or 8 #85
Comments
@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. |
Awesome, thank you so much. |
Looks like node 8 behaves the same as node 7. |
@TehShrike Thank you for the information. I'm bit busy this week but still investigating... |
I've figured out this. // MIT © 2017 azu
const assert = require("assert");
try {
assert(false);
} catch (e) {
e.message = "custom message";
throw e;
} Node.js 6
Node.js 7
Node.js 8: (Error code is added: nodejs/node#12651)
Actually, empower does But, Node.js 7~ does not show this I think that Node.js 7~ treat try {
throw new Error("!");
} catch (e) {
e.message = "custom message";
throw e;
} Node 8 work fine.
|
This change is introduced by nodejs/node#11273 |
when `modifyMessageOnRethrow` option is truthy. since Node v8 (and v7) does not update message on rethrow. refs power-assert-js/power-assert#85
when `modifyMessageOnRethrow` option is truthy. since Node v8 (and v7) does not update message on rethrow. refs power-assert-js/power-assert#85
After updating the dependencies in my power-assert-espower-repro repository (and removing the duplicate log/throw), this is the output using node 8:
|
@TehShrike Yeah we did it! Thank you for reporting again. |
This issue is fixed by power-assert 1.4.4 |
I am trying to use
power-assert
to get pretty assert output in node, without using mocha or babel.I'm trying to implement assertions by reading the documentation, but haven't been able to get it working so far.
Here is my attempt at a "vanilla node" (no mocha) seed: https://github.com/TehShrike/power-assert-espower-repro
entry point:
test/test.js:
Instead of a nice pretty error message, I get:
What am I missing? I'm guessing this is a documentation/implementation issue, and not an actual bug.
(node 7.6.0)
The text was updated successfully, but these errors were encountered: