discordjs / discord.js-modules

Modularisation of discord.js (WIP)
Apache License 2.0
192 stars 30 forks source link

test(rest): replace usages of toEqual with toStrictEqual or toBe #39

Closed jonahsnider closed 3 years ago

jonahsnider commented 3 years ago

Please describe the changes this PR makes and why it should be merged:

Some of the tests in the REST package were using toEqual, which should be replaced with toStrictEqual or toBe when possible.

toStrictEqual not only checks that two objects contain the same data but also that they have the same structure. It is common to expect objects to not only have identical values but also to have identical keys. A stricter equality will catch cases where two objects do not have identical keys.

In the future consider using eslint-plugin-jest's prefer-strict-equal rule to automate this.

Status and versioning classification:

Only modifies tests, the version should not be changed.

codecov[bot] commented 3 years ago

Codecov Report

Merging #39 (91b8f39) into master (6990f0f) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #39   +/-   ##
=======================================
  Coverage   89.46%   89.46%           
=======================================
  Files          11       11           
  Lines        1386     1386           
  Branches      104      104           
=======================================
  Hits         1240     1240           
  Misses         42       42           
  Partials      104      104           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6990f0f...91b8f39. Read the comment docs.