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-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(); | |
| }); | |
| }); |