Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Clone in Desktop Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (17 sloc) 769 Bytes
var Checker = require('../../../lib/checker');
var expect = require('chai').expect;
describe('rules/disallow-shorthand-arrow-functions', function() {
var checker;
beforeEach(function() {
checker = new Checker();
checker.registerDefaultRules();
checker.configure({ esnext: true, disallowShorthandArrowFunctions: true });
});
it('should report a shorthand arrow function expression', function() {
expect(checker.checkString('evens.map(v => v + 1);'))
.to.have.one.validation.error.from('disallowShorthandArrowFunctions');
});
it('should not report an arrow function with a block', function() {
expect(checker.checkString('evens.map(v => { return v + 1; });')).to.have.no.errors();
});
});
Jump to Line
Something went wrong with that request. Please try again.