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

vitest/valid-expect false errors on chai style expects #237

Closed
GNRSN opened this issue Aug 31, 2023 · 4 comments · Fixed by #328
Closed

vitest/valid-expect false errors on chai style expects #237

GNRSN opened this issue Aug 31, 2023 · 4 comments · Fixed by #328

Comments

@GNRSN
Copy link

GNRSN commented Aug 31, 2023

Hi, we're having a lot of mocha/chai test which we've migrated to vitest, written in chai syntax as is supported by vitest. The following example:

const fooBar = {foo: 'bar'};
expect(fooBar).to.deep.eq({foo: 'bar'});

Errors as vitest/valid-expect

I assume this is a bug/lacking support for chai syntax?

@veritem
Copy link
Member

veritem commented Sep 2, 2023

what kind of error? would you mind sharing a repo with repro. I can fix this faster with more context. Thanks

@GNRSN
Copy link
Author

GNRSN commented Sep 2, 2023

The error description is "Expect has unknown modifier" (it's an eslint "Error")

Thank you for your quick responses!
I've created a repro here https://github.com/GNRSN/repro-vitest-eslint-plugin-237/tree/main

@yoavniran
Copy link

just moved to vitest and added this fine plugin.
Getting the same problem (using chai matchers).

for example:

expect(value).to.eql("30");

error:

 6:3  error  Expect has unknown modifier  vitest/valid-expect

@RebeccaStevens
Copy link

This issue doesn't seem fixed.

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

Successfully merging a pull request may close this issue.

4 participants