Protect against a FF bug: Exceptions don't always have a message property even though they were instantiated with one. Using Error#toString alleviates this

This commit is contained in:
Dan Hansen and Davis W. Frank
2013-03-01 10:43:09 -08:00
parent b7af6abca5
commit b22bf9a031
3 changed files with 9 additions and 2 deletions

View File

@@ -6,6 +6,13 @@ describe("Spec", function() {
expect(jasmine.Spec.isPendingSpecException(e)).toBe(true);
});
it("#isPendingSpecException returns true for a pending spec exception (protect against FF bug)", function() {
var e = new Error(jasmine.Spec.pendingSpecExceptionMessage);
delete e.message;
expect(jasmine.Spec.isPendingSpecException(e)).toBe(true);
});
it("#isPendingSpecException returns true for a pending spec exception", function() {
var e = new Error("foo");