Skip to content

tools,test: enforce deepStrictEqual over deepEqual

Rodrigo Muino Tomonari requested to merge github/fork/Trott/no-deepEqual into master
Checklist
  • tests and code linting passes
  • the commit message follows commit guidelines
Affected core subsystem(s)

tools, test, benchmark

Description of change

Introduce a lint rule that enforces use of assert.deepStrictEqual() over assert.deepEqual().

This is a proof of concept inspired by @Fishrock123 wondering in https://github.com/nodejs/node/pull/6196#issuecomment-209998141:

We could make a lint rule that requires strict assertions for the tests, but I feel people may be opposed to that?

I like it, but (like Fishrock123) I don't know if others will feel the same.

If this is deemed a good idea, it can optionally evolve from no-deepEqual to something that flags all non-strict assertions, perhaps only in the tests. Not going to bother, though, if there isn't consensus on this.

Merge request reports

Loading