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

Commit d2d3bfe

Browse files
committed
maximumLineLength spec: add should not report functions within IIFE blocks
currently when a function definition is wrapped in an IIFE block, functionSignature fails to ignore the line lenght .. added spec to test for the correct behaviour issue #2032
1 parent 04b3274 commit d2d3bfe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,13 @@ describe('rules/maximum-line-length', function() {
218218
var code = 'var fn = function() {};';
219219
expect(checker.checkString(code)).to.have.one.validation.error.from('maximumLineLength');
220220
});
221+
222+
it('should not report functions within IIFE blocks', function() {
223+
var code = '(function() {\n' +
224+
' function myCoolFunction(argument) { }\n' +
225+
'})();';
226+
expect(checker.checkString(code)).to.have.no.errors();
227+
});
221228
});
222229

223230
describe('allExcept["require"] option', function() {

0 commit comments

Comments
 (0)