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

25 lines (19 sloc) 867 Bytes
var Checker = require('../../../lib/checker');
var expect = require('chai').expect;
describe('rules/require-spread', function() {
var checker;
beforeEach(function() {
checker = new Checker();
checker.registerDefaultRules();
checker.configure({ esnext: true, requireSpread: true });
});
it('should report use of apply when the first param === the object of the member expression', function() {
expect(checker.checkString('g.apply(g, arguments);')).to.have.one.validation.error.from('requireSpread');
});
it('should not report the use apply with only 1 argument', function() {
expect(checker.checkString('g.apply(arguments);')).to.have.no.errors();
});
it('should not report the use of spread', function() {
expect(checker.checkString('g(...args);')).to.have.no.errors();
});
});
Jump to Line
Something went wrong with that request. Please try again.