-
Notifications
You must be signed in to change notification settings - Fork 22
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
qunit/require-expect
reports some warnings that it should not
#244
Comments
Hi @cah-brian-gantzler, thanks for the report. Can you please share what configuration you are using for this rule? |
I think the linter was installed by ember-cli-update. I changed no files so should be whatever the default is. What file should I look at to give you the configuration? |
Ember just uses the Note that we are planning to change the default config for this require-expect rule to |
I agree that except-simple should handle blocks that aren't conditionally executed. The intention is to require expect when someone puts an assertion inside an if statement or other conditional logic. As for function callbacks, we have no way to infer statically that the callback is always executed. So we would probably need to consider enhancing the rule to support user-supplied function names that the rule can "trust". I don't remember if we have an open issue for that or not (I'm on mobile so I can't check easily while writing this). I definitely consider the block case as a bug and would happily review any contributions to fix. Thanks! |
Im assuming |
@cah-brian-gantzler I'm not sure I agree with that because the number of iterations might not be statically determinable. "except-simple" means we want to see You can always override your config to use a different, more lenient setting (such as |
@cah-brian-gantzler Do you still believe a change is needed to this rule? Or does the |
Have thought about this a lot and converted several tests to what works, doesnt work. Yes I believe that Thanks for asking. |
The following report a missing expect when an expect should not be needed.
This was used for scoping to make copy and paste easier so that the lets were local. However since the call value is changing, I could see this in a
for
orforEach
loop, would that still trigger the warning?Ember cli page object allows an
as
function to alias a variable. This also triggers the require-expectThis one could be rewritten as below, but obsoletes the
as
function from page object. Again the index ofobjectAt
could be in afor
orforEach
which Im not sure if the linter takes into account.The text was updated successfully, but these errors were encountered: