Update sinon-chai to use latest versions of chai and sinon #162
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm trying to update this package to be used with the new version of
chai
(from v4 to v5), andsinon
(from v9 to v17).chai
is now an ESM module, so this package must be migrated to ESM too. This would solve #160.Important
There is a different PR from @robinbisping (#161) that updates "just"
chai
and I think works fine, should be accepted first. This one tries to update bothchai
andsinon
and it's not working yet.Done:
require
toimport
/export
.Need reviewing:
sinon-chai
used the UMD pattern to allow using it with AMD, CommonJS and browser. With ESM modules this is (i think) no longer necessary, just an ESM module with export... but I'm a backend programmer, so I need somebody to test this.sinon
has been updated from v9 to v17... some things have changed, and the information messages shown to the user are different. I've changed some of the "expected foo but bar" messages to better match the current sinon styles... and the existing tests to fit those new messages. Needs review.Need to fix:
There are 5 tests which i'm not able to fix:
I don't know why
sinon
tries to serialize some objects instead of returning just a string with the right message. Don't know enough about the inner workings ofsinon
to understand what is happening. Somebody wants to help?