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

Guard idiomatic Chai expressions from ESLint no-unused-expressions #177

Open
bfinney-thoughtworks opened this issue Apr 3, 2018 · 1 comment

Comments

@bfinney-thoughtworks
Copy link

bfinney-thoughtworks commented Apr 3, 2018

For bugs:

Expected behaviour:

The ESLint tests should pass for all code, with no warnings.

Actual behaviour:

The test case code is flagged by ESLint with these warnings:

/app/backend/spec/unit/lib/inputValidatorSpec.js
   25:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
   32:7  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
   43:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
   54:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
   72:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
   84:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  100:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  111:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  125:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  138:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  155:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  165:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  172:7  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  182:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  190:7  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  194:7  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  207:9  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions

/app/backend/spec/unit/lib/memberValidatorSpec.js
  23:7  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions
  28:7  warning  Expected an assignment or function call and instead saw an expression  no-unused-expressions

✖ 19 problems (0 errors, 19 warnings)

These are because the idiomatic Chai usage of expect(foo).to-be-true, etc., is an expression which appears unused.

@bfinney-thoughtworks
Copy link
Author

I have created merge request #178 to resolve this.

@bfinney-thoughtworks bfinney-thoughtworks changed the title Guard idiomatic Expect expressions from ESLint no-unused-expressions Guard idiomatic Chai expressions from ESLint no-unused-expressions Apr 20, 2018
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

1 participant