Permalink
Jump to Line
Branch:
master
Switch branches/tags
dollar-ignores
feature/new-rule-require-new-lines-in-array
gh-pages
issues/1242
issues/1271-related
master
mdevils/cst
Nothing to show
Nothing to show
Fetching contributors…
![]()
Cannot retrieve contributors at this time
| var Checker = require('../../../lib/checker'); | |
| var expect = require('chai').expect; | |
| describe('rules/disallow-arrow-functions', function() { | |
| var checker; | |
| beforeEach(function() { | |
| checker = new Checker(); | |
| checker.registerDefaultRules(); | |
| checker.configure({ disallowArrowFunctions: true, esnext: true }); | |
| }); | |
| it('should report use of arrow function', function() { | |
| expect(checker.checkString('a.map(n => n + 1);')).to.have.one.validation.error.from('disallowArrowFunctions'); | |
| }); | |
| it('should report use of multi line arrow function', function() { | |
| expect(checker.checkString([ | |
| 'a.map(n => {', | |
| 'return n + 1;', | |
| '});' | |
| ].join('\n'))).to.have.one.validation.error.from('disallowArrowFunctions'); | |
| }); | |
| }); |