We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a9191cb commit d786a63Copy full SHA for d786a63
test/diffTest.js
@@ -159,6 +159,17 @@ describe('#diffJson', function() {
159
{a: 123, b: 456, c: 789});
160
diff.convertChangesToXML(diffResult).should.equal('{\n "a": 123,\n "b": 456,\n<ins> "c": 789\n</ins>}');
161
});
162
+
163
+ it('should throw an error if one of the objects being diffed has a circular reference', function() {
164
+ var circular = {foo: 123};
165
+ circular.bar = circular;
166
+ (function () {
167
+ diff.diffJson(
168
+ circular,
169
+ {foo: 123, bar: {}}
170
+ );
171
+ }).should.throw('Converting circular structure to JSON');
172
+ });
173
174
175
describe('convertToDMP', function() {
0 commit comments