Better failure message when something is thrown that's not an error

Change from 'undefined : undefined' to '<thing that was thrown> thrown'

Pointed out by @charleshansen
This commit is contained in:
Sheel Choksi
2014-01-09 22:10:40 -08:00
parent aab4808410
commit 06a553503d
3 changed files with 21 additions and 6 deletions

View File

@@ -35,7 +35,14 @@ describe("ExceptionFormatter", function() {
message = exceptionFormatter.message(sampleV8);
expect(message).toEqual('A Classic Mistake: you got your foo in my bar');
});
it("formats thrown exceptions that aren't errors", function() {
var thrown = "crazy error",
exceptionFormatter = new j$.ExceptionFormatter(),
message = exceptionFormatter.message(thrown);
expect(message).toEqual("crazy error thrown");
});
});