Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chai v5 support #160

Open
stephen-willoughby opened this issue Jan 2, 2024 · 9 comments
Open

Chai v5 support #160

stephen-willoughby opened this issue Jan 2, 2024 · 9 comments

Comments

@stephen-willoughby
Copy link

Now chai v5 is out, it would be helpful if sinon-chai could also support it

@neverbot
Copy link

@domenic I think the first pull request (#161) from @robinbisping solves this issue, could it be accepted? Thanks in advance!

@dschweinbenz
Copy link

push

@ddolcimascolo
Copy link

Hi,

So while adding support for chai@5 you dropped support for chai@4?

David

@43081j
Copy link
Contributor

43081j commented Jul 26, 2024

chai 5 is ESM-only, while chai 4 is commonjs

if you haven't had chance to move to ESM yet, you should stick to chai 4 (and the older sinon-chai version)

mixing them up leads to various problems since you can't (currently) require ESM modules in node. so it is one or the other

@ddolcimascolo
Copy link

Yeah. I'm too tired to once again explain that breaking the ecosystem is not cool. Thanks for maintaining open source projects, keep up the good work.

Cheers,
David

@crfrolik
Copy link

Yeah. I'm too tired to once again explain that breaking the ecosystem is not cool. Thanks for maintaining open source projects, keep up the good work.

Cheers, David

That's why it was a major version bump, since it is a breaking change.

Realistically, supporting both ESM and commonjs is challenging. At best it's extra work.
Since ESM is "the future" of JavaScript, it makes sense to move to that and ask commonjs folks to stick with chai 4 etc. until they are ready to migrate.

@43081j
Copy link
Contributor

43081j commented Jul 26, 2024

Indeed, nobody has "broken" the ecosystem here

If you don't have time to move to esm, use chai 4 until you do.

As per semver, chai 5 is a breaking change to switch to esm. The feature set is pretty much the same as 4.

If you still think the ecosystem is broken, it is important you explain yourself so we can investigate it.

@s100
Copy link

s100 commented Jul 29, 2024

For clarity I think it would be useful to document the fact that sinon-chai@4.0.0 drops support for Chai 4 in the change log for v4.0.0.

@43081j
Copy link
Contributor

43081j commented Jul 29, 2024

im not sure its so simple

sinon-chai 4.x should work fine with chai 4, assuming your project is written as ES modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants