Skip to content

deepEqual(true, [ 1 ]) #26

@mk-pmb

Description

@mk-pmb

Hi!
I'm developing an assert lib and it disagrees with this one:

~/commonjs-assert$ git-log-concise -n 1
Mon 2016-06-27 02:58    f8975ca Add deepStrictEqual to the README (#23)

~/commonjs-assert$ nodejs -e 'require("./assert.js").deepEqual(true, [ 1 ]);'
[…]
AssertionError: true deepEqual [ 1 ]

I'd prefer my lib to also throw an error on this, but I can't find permission for that in the CJS Unit Testing 1.0 spec. According to my lib, rule 7.3 applies, because one of the values is not an object, so they don't "both pass" the typeof object test. As said, I prefer your module's behavior, so what reading of the spec did you come up with to legitimate throwing?

Node.js also throws, but to me it seems it's unintentional there.

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