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-tabs', function() { | |
| var checker; | |
| beforeEach(function() { | |
| checker = new Checker(); | |
| checker.registerDefaultRules(); | |
| checker.configure({ disallowTabs: true }); | |
| }); | |
| it('should report tab', function() { | |
| expect(checker.checkString('\tvar foo;')).to.have.one.validation.error.from('disallowTabs'); | |
| }); | |
| it('should report tab in comment', function() { | |
| expect(checker.checkString('\t// a comment')).to.have.one.validation.error.from('disallowTabs'); | |
| }); | |
| it('should report tab at end of line', function() { | |
| expect(checker.checkString('var foo;\t')).to.have.one.validation.error.from('disallowTabs'); | |
| }); | |
| it('should not report tab', function() { | |
| expect(checker.checkString('var foo;')).to.have.no.errors(); | |
| }); | |
| }); |