Skip to content

Compare Maps and Sets #54

@mattiasholmlund

Description

@mattiasholmlund

@substack wrote in tape-testing/tape#342:

Once this is merged into core I will release a new major version of deep-equal based on the new algorithm that tape can be updated to support.

As far as I can see, node 8 has a deepEqual that can properly compare Maps and Sets:

node-v8.9.4-linux-x64 $ ./bin/node
> const assert = require('assert')
undefined
> assert.deepEqual(new Set('a'), new Set('a'))
undefined
> assert.deepEqual(new Set('a'), new Set('b'))
AssertionError [ERR_ASSERTION]: Set { 'a' } deepEqual Set { 'b' }
>

I find Sets and Maps very useful and want to use them with t.deepEqual() in tape.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions