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
If I understand our code correctly, it is currently limited to literal primitives in terms of recognising "literal" values, so when both values are literals but one is using an array or object, it is (imho wrongly) expressing a warning to swap them around.
74:16 error Expected value "foo" should be specified after actual value [ "foo" ] qunit/literal-compare-order
75:16 error Expected value "foo" should be specified after actual value { toString: function() { return "foo"; } } qunit/literal-compare-order
76:16 error Expected value 0 should be specified after actual value [ 0 ] qunit/literal-compare-order
94:25 error Expected value "foo" should be specified after actual value [ "foo" ] qunit/literal-compare-order
96:25 error Expected value "foo" should be specified after actual value { toString: function() { return "foo"; } } qunit/literal-compare-order
524:19 error Expected value "foo" should be specified after actual value [ "foo" ] qunit/literal-compare-order
525:19 error Expected value "foo" should be specified after actual value { toString: function() { return "foo"; } } qunit/literal-compare-order
526:19 error Expected value 0 should be specified after actual value [ 0 ] qunit/literal-compare-order
532:22 error Expected value "foo" should be specified after actual value [ "foo" ] qunit/literal-compare-order
534:22 error Expected value "foo" should be specified after actual value { toString: function() { return "foo"; } } qunit/literal-compare-order
I agree that the rule should only fire if at least one value is an expression with at least one identifier, so I'll mark this as a bug.
I'm not sure if it's better to have a larger list of "literal" types, or if we should instead have a list of "non-literal" types to check against, or if we should have a recursive check that looks for identifiers... Thoughts and/or PRs appreciated!
If I understand our code correctly, it is currently limited to literal primitives in terms of recognising "literal" values, so when both values are literals but one is using an array or object, it is (imho wrongly) expressing a warning to swap them around.
From https://github.com/qunitjs/qunit/blob/86fc89b3e443ccae5dedb5782412765c85a07a5e/test/main/assert.js#L523-L534
The text was updated successfully, but these errors were encountered: