referee icon indicating copy to clipboard operation
referee copied to clipboard

Documentation and assert.equals error message still reference deprecated (removed) defined assertion

Open gundelsby opened this issue 5 years ago • 4 comments

  • library version : 4.0.0
  • Environment : Node 13.5.0
  • Example URL : https://sinonjs.github.io/referee/#defined
  • Other libraries you are using: Mocha 7.0.0

What did you expect to happen? Documentation should be up to date. Error messages from assertions should be accurate.

What actually happens Documentation still lists the predefined assert defined, and not isUndefined. Error message from predefined assert equals gives the following error message if the expectiation value is undefined:

AssertionError: [assert.equals] Expectation for equals should not be undefined. Use assert.defined or refute.defined instead.

How to reproduce assert.equals('not undefined', undefined)

gundelsby avatar Feb 21 '20 17:02 gundelsby

Thank you for reporting this issue! That would require few changes to fix.

The new assertion is called assert.isUndefined.

Would you like to make a PR to fix it?

mroderick avatar Feb 21 '20 17:02 mroderick

I could, but since I've never made a contribution to this project before it probably will take some time. Guess there's no rush if I'm the only one complaining on a change that's over a year old though :)

gundelsby avatar Feb 25 '20 11:02 gundelsby

This would be the line to change: https://github.com/sinonjs/referee/blob/master/lib/assertions/equals.js#L19

I ran into this myself not long ago :)

mroderick avatar Feb 26 '20 15:02 mroderick

I noticed while doing the PR that even though the docs in the repo has been updated, the website (https://sinonjs.github.io/referee) still shows what I assume is an old version. So I guess that needs to be updated too?

gundelsby avatar Feb 27 '20 10:02 gundelsby