Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit a8517fe

Browse files
committed
maximumLineLength spec: functions in variables should test all variations
`should not report functions stored in variables` only tested a nameless, parameterless function, that was actually too short anyway fix to test var, let, and const, with or without identifier or params
1 parent a2827a2 commit a8517fe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/specs/rules/maximum-line-length.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,12 @@ describe('rules/maximum-line-length', function() {
215215
});
216216

217217
it('should not report functions stored in variables', function() {
218-
var code = 'var fn = function() {};';
218+
var code = 'var fn1 = function(longer) { return null; };\n' +
219+
'let fn2 = function(longer) { return null; };\n' +
220+
'const fn3 = function() { return "no_params_or_id"; };\n' +
221+
'var fn4 = function myFn4() { return null; };\n' +
222+
'let fn5 = function myFn5() { return null; };\n' +
223+
'const fn6 = function myFn6(whynot) { return null; };';
219224
expect(checker.checkString(code)).to.have.no.errors();
220225
});
221226

0 commit comments

Comments
 (0)