Skip to content

Commit 693c32a

Browse files
committed
Add test to verify array functionality
1 parent 645deb1 commit 693c32a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

packages/dd-trace/test/debugger/devtools_client/snapshot-pruner.spec.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,38 @@ describe('snapshot-pruner', function () {
498498
})
499499
})
500500

501+
it('should prune objects inside Map entries (arrays of arrays)', function () {
502+
assertPrunedSnapshot(-1, {
503+
myMap: {
504+
type: 'map',
505+
entries: [
506+
[
507+
{ type: 'string', value: 'key1' },
508+
{ type: 'string', value: 'x'.repeat(500) } // Should be pruned
509+
],
510+
[
511+
{ type: 'string', value: 'key2' },
512+
{ type: 'string', value: 'small' }
513+
]
514+
]
515+
}
516+
}, {
517+
myMap: {
518+
type: 'map',
519+
entries: [
520+
[
521+
{ type: 'string', value: 'key1' },
522+
{ pruned: true }
523+
],
524+
[
525+
{ type: 'string', value: 'key2' },
526+
{ type: 'string', value: 'small' }
527+
]
528+
]
529+
}
530+
})
531+
})
532+
501533
/**
502534
* Assert that the pruneSnapshot function successfully prunes the snapshot and returns the expected locals.
503535
* @param {number} maxSize - Used to define the max allowed size of the snapshot. If positive, it's the absolute max

0 commit comments

Comments
 (0)