Skip to content

Commit 634f1c9

Browse files
committed
Add test
1 parent defaa98 commit 634f1c9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/unit/utils-test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,17 @@ describe('Common utils', function () {
107107
var result = utils.createOutputObject(root);
108108
result.should.eql(expected);
109109
});
110+
111+
it('should not fail on referential loop', function() {
112+
var root = new Resource('http://example.com', 'index.html');
113+
var child1 = root.createChild('http://child-one.com', 'child1.html');
114+
var child2 = root.createChild('http://child-two.com', 'child2.html');
115+
// create referential loop
116+
var rootCopy = child1.createChild('http://example.com');
117+
child1.updateChild(rootCopy, root);
118+
119+
var result = utils.createOutputObject(root);
120+
result.should.be.not.empty();
121+
});
110122
});
111123
});

0 commit comments

Comments
 (0)