source: imaps-frontend/node_modules/object-inspect/test/circular.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 451 bytes
RevLine 
[d565449]1var inspect = require('../');
2var test = require('tape');
3
4test('circular', function (t) {
5 t.plan(2);
6 var obj = { a: 1, b: [3, 4] };
7 obj.c = obj;
8 t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }');
9
10 var double = {};
11 double.a = [double];
12 double.b = {};
13 double.b.inner = double.b;
14 double.b.obj = double;
15 t.equal(inspect(double), '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }');
16});
Note: See TracBrowser for help on using the repository browser.