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

19 lines (17 sloc) 694 Bytes
var Checker = require('../../../lib/checker');
var expect = require('chai').expect;
describe('rules/disallow-keywords', function() {
var checker;
beforeEach(function() {
checker = new Checker();
checker.registerDefaultRules();
});
it('should report illegal keyword', function() {
checker.configure({ disallowKeywords: ['with'] });
expect(checker.checkString('with (x) { y++; }')).to.have.one.validation.error.from('disallowKeywords');
});
it('should not report legal keywords', function() {
checker.configure({ disallowKeywords: ['with'] });
expect(checker.checkString('if(x) { x++; }')).to.have.no.errors();
});
});
Jump to Line
Something went wrong with that request. Please try again.