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
I have a large codebase with many different types of tests, including many that look like this:
test('it has the right URL', function() {
expect(url).to.equal('/items/library');
});
This test case causes the following crash:
TypeError: Cannot read property 'type' of undefined
Occurred while linting <input>:1
at checkLiteralCompareOrder (lib/rules/literal-compare-order.js:42:77)
at processAssertion (lib/rules/literal-compare-order.js:67:17)
at CallExpression (lib/rules/literal-compare-order.js:79:21)
It appears that this is happening because there is only one argument to equal instead of the expected 2+ arguments.
The rule likely should be ignoring my usage of equal because it doesn't have the expected form.
And note that this same problem occurs with other functions covered by the rule (strictEqual, notDeepEqual, etc).
The text was updated successfully, but these errors were encountered:
We definitely want to fix the crash (PR would be welcome). At a later point, we should also do more to ensure that all of the QUnit-related functions are actually imported from QUnit, but that will be a wider change.
In the meantime-- to unblock you as fast as possible-- I would recommend seeing if you can use ESLint's glob-based configuration feature to see if you can override ESLint to not run the eslint-plugin-qunit rules on files that use other test frameworks. That will hopefully help you until the rule is fixed not to crash!
I have a large codebase with many different types of tests, including many that look like this:
This test case causes the following crash:
It appears that this is happening because there is only one argument to
equal
instead of the expected 2+ arguments.The rule likely should be ignoring my usage of
equal
because it doesn't have the expected form.And note that this same problem occurs with other functions covered by the rule (
strictEqual
,notDeepEqual
, etc).The text was updated successfully, but these errors were encountered: