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

should.be.true syntax that passes eslint #445

Closed
jwynveen opened this issue May 14, 2015 · 3 comments
Closed

should.be.true syntax that passes eslint #445

jwynveen opened this issue May 14, 2015 · 3 comments

Comments

@jwynveen
Copy link

I am trying to update from 1.10.0 to the current version, but there seem to be breaking changes. We are using object.should.be.true() throughout our tests, but it seems to no longer exists as a function. I see in the release notes that there is information about it being a property, although the function is supposed to still exist for linting purposes. That note was on 1.10.0. It seems the function no longer exists and there are no further release notes about it. I can easily switch all of them, but then they don't pass my eslint rules. How is that type of assertion supposed to be used in a way that passes eslint?

@keithamus
Copy link
Member

Hey @jwynveen thanks for the issue.

We dropped that style as of 2.0.0 (as the release noted state - it was incompatible with the old style).

#371 also mentions this - so this issue is a duplicate of that. Have a look at #371 (comment) for some full context and history.

Solutions:

  1. Drop your lint rule, either just for your test suite or on the whole project.
  2. Avoid using the getters, so replace .to.be.true with .to.equal(true) and .to.exist with .to.not.equal(undefined).

I've been thinking up a solution for this - which one day may be implemented, but don't hold your breath.

@luislobo
Copy link

which would be the equivalent of variable.should.not.be.empty, as a function?

@keithamus
Copy link
Member

@luislobo you probably should test what it is rather than what it isn't, so for example variable.should.be.an('array').with.lengthOf(3)

SizZiKe pushed a commit to SizZiKe/serverless-step-functions that referenced this issue Nov 6, 2020
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

3 participants