Skip to content

assert: add support for Set and Map

Previously, assert.deepEqual used on maps and sets was not functioning correctly.

This change adds support for correctly comparing Maps and Sets.

For Maps, comparison is done by iterating over each item in both Maps and verifying that the key exists and the value is the same (depending on whether strict is applied).

For Sets, each item is iterated in each Set and checked if it exists in the other Set.

For both Maps and Sets, the size of both being compared is checked as well.

Related: https://github.com/nodejs/io.js/issues/2309

Merge request reports

Loading