aboutsummaryrefslogtreecommitdiffstats
path: root/backend/node_modules/object-inspect/test/deep.js
blob: 99ce32a088f90f217c1e4b001f4e41d3ddd4f3ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
var inspect = require('../');
var test = require('tape');

test('deep', function (t) {
    t.plan(4);
    var obj = [[[[[[500]]]]]];
    t.equal(inspect(obj), '[ [ [ [ [ [Array] ] ] ] ] ]');
    t.equal(inspect(obj, { depth: 4 }), '[ [ [ [ [Array] ] ] ] ]');
    t.equal(inspect(obj, { depth: 2 }), '[ [ [Array] ] ]');

    t.equal(inspect([[[{ a: 1 }]]], { depth: 3 }), '[ [ [ [Object] ] ] ]');
});