Fixed diffs involving jasmine.objectContaining
This commit is contained in:
@@ -125,7 +125,8 @@ describe("ObjectContaining", function() {
|
||||
describe("when other is not an object", function() {
|
||||
it("sets self to jasmineToString()", function () {
|
||||
var containing = new jasmineUnderTest.ObjectContaining({}),
|
||||
result = containing.valuesForDiff_('a');
|
||||
pp = jasmineUnderTest.makePrettyPrinter(),
|
||||
result = containing.valuesForDiff_('a', pp);
|
||||
|
||||
expect(result).toEqual({
|
||||
self: '<jasmine.objectContaining(Object({ }))>',
|
||||
|
||||
@@ -40,12 +40,4 @@ describe('ObjectPath', function() {
|
||||
expect(path.toString()).toEqual('$.foo');
|
||||
expect(root.toString()).toEqual('');
|
||||
});
|
||||
|
||||
describe('#dereference', function() {
|
||||
it('returns the value corresponding to the path', function () {
|
||||
var path = new ObjectPath().add('foo').add(1).add('bar');
|
||||
var obj = {foo: ['', {bar: 42}]};
|
||||
expect(path.dereference(obj)).toEqual(42);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -429,10 +429,10 @@ describe("toEqual", function() {
|
||||
expect(compareEquals(actual, expected).message).toEqual(message);
|
||||
});
|
||||
|
||||
it("reports mismatches involving objectContaining", function() {
|
||||
it("reports mismatches involving objectContaining and an object", function() {
|
||||
var actual = {x: {a: 1, b: 4, c: 3, extra: 'ignored'}};
|
||||
var expected = {x: jasmineUnderTest.objectContaining({a: 1, b: 2, c: 3})};
|
||||
expect(compareEquals(actual, expected).message).toEqual('Expected $.x.b = 4 to equal 2.')
|
||||
expect(compareEquals(actual, expected).message).toEqual('Expected $.x.b = 4 to equal 2.');
|
||||
});
|
||||
|
||||
it("reports mismatches between a non-object and objectContaining", function() {
|
||||
|
||||
Reference in New Issue
Block a user