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

New rule: no-ok-equality #7

Closed
platinumazure opened this issue Sep 1, 2015 · 0 comments
Closed

New rule: no-ok-equality #7

platinumazure opened this issue Sep 1, 2015 · 0 comments

Comments

@platinumazure
Copy link
Collaborator

We should create a rule which ensures that equality checks are not performed as the assertion argument of assert.ok and assert.notOk.

Ideally, the rule would suggest a better assertion to use instead:

  • assert.ok(a === b) would become assert.strictEqual(a, b)
  • assert.ok(a == b) would become assert.equal(a, b)
  • assert.ok(a !== b) would become assert.notStrictEqual(a, b)
  • assert.ok(a != b) would become assert.notEqual(a, b)
  • assert.notOk(a === b) would become assert.notStrictEqual(a, b)
  • assert.notOk(a == b) would become assert.notEqual(a, b)
  • assert.notOk(a !== b) would become assert.strictEqual(a, b)
  • assert.notOk(a != b) would become assert.equal(a, b)
platinumazure added a commit that referenced this issue Oct 12, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Error message still needs to be improved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant