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
Jasmine Swallows Error Message when throwing own Exception #638
Comments
By the way, my actual problem is that peg.js constructs it's own function peg$subclass(child, parent) {
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor();
}
function SyntaxError(message, expected, found, offset, line, column) {
this.message = message;
this.expected = expected;
this.found = found;
this.offset = offset;
this.line = line;
this.column = column;
this.name = "SyntaxError";
}
peg$subclass(SyntaxError, Error); |
Previously, was only printing out the stack while the html reporter would print out the message as well as the stack. Now they should be more consistent. As noticed by @despairblue in #638
It looks like theres a bit of an inconsistency between the browser reporter and the console reporter. The browser reporter prints out both the message and stack, while the console reporter only prints the stack. I just pushed a commit to fix that. The message shown in the browser is the message you have overridden ('bar') while the stack contains the offending 'foo', since the stack property hasn't been overridden. As this stack overflow post suggests, you could override the stack property as well to be something like Does this help resolve the issue? |
Doing something like this in the code that's going to be tested (or in an
it
):Jasmine will report this:
You see that jasmine seems to report the prototypes message. Not the one from
myerror
. Is this me misunderstanding prototypes or is this actually some kind of error in jasmine?The text was updated successfully, but these errors were encountered: