You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this code sample, the custom equal function below is flagged as a violation of the qunit/no-assert-equal, even though this equal function is not the QUnit assert equal function.
import{module,test}from'qunit';import{equal}from'my-custom-library';// `equal` could come from an importfunctionequal(a,b){}// or `equal` could be locally definedmodule('My Test Suite',function(){test('it works',function(assert){assert.notOk(equal(123,456));});});
The text was updated successfully, but these errors were encountered:
Thanks @bmish for the issue. I agree this is a bug on the surface.
I'm not sure we have any other way of solving it besides enhancing the rule with an option to check for global or not. I don't think the rule should look at the import line and assume that all QUnit assertions must be imported. But if you think we can solve this as a bug fix, please share any ideas you have.
@platinumazure I just clarified the example in this ticket to show that equal is either imported from elsewhere or a custom function defined locally. So the problem with the rule is actually that the rule simply does not properly check for the global. We should assume global equal is the qunit assertion that we want to disallow, but in my example, equal is clearly not a global. This is a relatively easy fix that I opened in #183.
In this code sample, the custom
equal
function below is flagged as a violation of the qunit/no-assert-equal, even though thisequal
function is not the QUnit assertequal
function.The text was updated successfully, but these errors were encountered: