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

More suggestions #95

Open
RettentoRectangle opened this issue Apr 18, 2023 · 2 comments
Open

More suggestions #95

RettentoRectangle opened this issue Apr 18, 2023 · 2 comments

Comments

@RettentoRectangle
Copy link

It'd be nice to have more suggestions:

expect(typeof x === 'string') -> expect(x).toBeString()
expect(typeof x === 'boolean') -> expect(x).toBeBoolean()
expect(typeof x === 'number') -> expect(x).toBeNumber()
expect(x.includes(y)) -> expect(x).toInclude(y)

And so on.

@G-Rath
Copy link
Collaborator

G-Rath commented Apr 18, 2023

PRs are welcome, though these would be new rules rather than suggestions - I would prefer we have specific issues rather than one generic one like this though, because what you're effectively asking for here is every rule for every matcher which will take a while 😅

I think toInclude would be an easy one to start with - I had played with some more for ones like toBeNumber, but there are a bunch of cases to cover (which are also not even covered by our current rules) and not a lot of actual users of this plugin so I didn't take it very far.

I'm happy to review PRs though and continue maintaining with new rules, fixes, etc if interest picks up :)

@RettentoRectangle
Copy link
Author

Sorry I mean autofix suggestions. :)
Of course they are rules.

We are thinking about to write them by ourself, I'll get some time for that.

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

2 participants