Resolve remaining test issues
This commit is contained in:
@@ -41,8 +41,11 @@ describe("ExceptionFormatter", function() {
|
||||
|
||||
describe("#stack", function() {
|
||||
it("formats stack traces from Webkit, Firefox or node.js", function() {
|
||||
if (isIE()) { return; }
|
||||
|
||||
var error;
|
||||
try { throw new Error("an error") } catch(e) { error = e; };
|
||||
try { throw new Error("an error") } catch(e) { error = e; }
|
||||
|
||||
expect(new j$.ExceptionFormatter().stack(error)).toMatch(/ExceptionFormatterSpec\.js.*\d+/)
|
||||
});
|
||||
|
||||
|
||||
@@ -9,7 +9,9 @@ describe("ObjectContaining", function() {
|
||||
it("does not match an empty object actual", function() {
|
||||
var containing = new j$.ObjectContaining("foo");
|
||||
|
||||
expect(containing.jasmineMatches({})).toBe(false);
|
||||
expect(function() {
|
||||
containing.jasmineMatches({})
|
||||
}).toThrowError(/not 'foo'/)
|
||||
});
|
||||
|
||||
it("matches when the key/value pair is present in the actual", function() {
|
||||
@@ -39,10 +41,21 @@ describe("ObjectContaining", function() {
|
||||
containing.jasmineMatches({foo: "fooVal", bar: "barVal"}, mismatchKeys, mismatchValues);
|
||||
|
||||
expect(mismatchValues.length).toBe(1);
|
||||
|
||||
expect(mismatchValues[0]).toEqual("'foo' was 'fooVal' in actual, but was 'other' in expected.");
|
||||
});
|
||||
|
||||
it("adds keys in expected but not actual to the mismatchKeys parameter", function() {
|
||||
var containing = new j$.ObjectContaining({foo: "fooVal"});
|
||||
|
||||
var mismatchKeys = [];
|
||||
var mismatchValues = [];
|
||||
|
||||
containing.jasmineMatches({bar: "barVal"}, mismatchKeys, mismatchValues);
|
||||
|
||||
expect(mismatchKeys.length).toBe(1);
|
||||
expect(mismatchKeys[0]).toEqual("expected has key 'foo', but missing from actual.");
|
||||
});
|
||||
|
||||
it("jasmineToString's itself", function() {
|
||||
var containing = new j$.ObjectContaining({});
|
||||
|
||||
|
||||
@@ -111,6 +111,8 @@ describe("matchersUtil", function() {
|
||||
});
|
||||
|
||||
it("passes for equivalent frozen objects (GitHub issue #266)", function() {
|
||||
if (isIE(8)) { return; }
|
||||
|
||||
var a = { foo: 1 },
|
||||
b = {foo: 1 };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user