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

Ensure boolean assertions are not missed by several rules #172

Merged
merged 5 commits into from
Apr 21, 2021

Conversation

bmish
Copy link
Collaborator

@bmish bmish commented Apr 10, 2021

Fixes #169. Adds the new boolean assertions (true and false) to our list of assertions so that they will be taken into account by several rules. Adds test cases to several rules.

Adds the new boolean assertions (`true` and `false`) to our list of assertions so that they will be taken into account by several rules. Adds test cases to several rules.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 374cba0 on bmish:boolean-assertions-missing into 8390fa7 on platinumazure:master.

@coveralls
Copy link

coveralls commented Apr 10, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling 3216960 on bmish:boolean-assertions-missing into 8390fa7 on platinumazure:master.

@@ -49,6 +50,7 @@ ruleTester.run("no-global-assertions", rule, {
wrap("assert.notPropEqual(a, b);"),
wrap("assert.raises(function () {}, TypeError);"),
wrap("assert.throws(function () {}, TypeError);"),
wrap("assert.true(foo);"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not able to add invalid test cases to this rule for the boolean assertions. Maybe true and falsecan't be added as globals because they are reserved keywords in JS?

Copy link
Owner

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of minor changes, I think. Let me know if I'm missing anything.

tests/lib/rules/assert-args.js Outdated Show resolved Hide resolved
tests/lib/rules/assert-args.js Outdated Show resolved Hide resolved
tests/lib/rules/assert-args.js Outdated Show resolved Hide resolved
tests/lib/rules/assert-args.js Outdated Show resolved Hide resolved
bmish and others added 4 commits April 20, 2021 17:59
Co-authored-by: Kevin Partington <platinumazure@gmail.com>
Co-authored-by: Kevin Partington <platinumazure@gmail.com>
Co-authored-by: Kevin Partington <platinumazure@gmail.com>
Co-authored-by: Kevin Partington <platinumazure@gmail.com>
@bmish
Copy link
Collaborator Author

bmish commented Apr 21, 2021

Just a couple of minor changes, I think. Let me know if I'm missing anything.

Accepted your suggestions.

@platinumazure
Copy link
Owner

Thanks!

@platinumazure platinumazure merged commit 05c9738 into platinumazure:master Apr 21, 2021
bmish added a commit to bmish/eslint-plugin-qunit that referenced this pull request Apr 21, 2021
* master:
  Update: Ensure boolean assertions are not missed by several rules (platinumazure#172)
  Chore: add eslint-plugin-eslint-comments (platinumazure#178)
  Docs: enable/autofix indent rule in markdown JS code samples (platinumazure#177)
  Docs: Add eslint-plugin-markdown for JavaScript code samples in documentation (platinumazure#176)
  Upgrade: Bump y18n from 4.0.0 to 4.0.1 (platinumazure#163)
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 this pull request may close these issues.

assert-related rules do not recognise assert.true() and assert.false()
3 participants