Skip to content

Commit

Permalink
test the case where babel-eslint is actually useful
Browse files Browse the repository at this point in the history
  • Loading branch information
shinnn committed Jul 4, 2016
1 parent eb98701 commit 08b9212
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/linting.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,32 @@ const BufferStreams = require('bufferstreams');
require('mocha');

describe('gulp-eslint plugin', () => {

it('should configure an alternate parser', done => {
eslint({
parser: 'babel-eslint',
useEslintrc: false,
rules: {'arrow-parens': 2}
rules: {'prefer-template': 'error'}
})
.on('error', done)
.on('data', file => {
should.exist(file);
should.exist(file.contents);
should.exist(file.eslint);
file.eslint.should.have.property('filePath', path.resolve('test/fixtures/es6.js'));
file.eslint.should.have.property('filePath', path.resolve('test/fixtures/stage0-class-property.js'));

file.eslint.messages
.should.be.instanceof(Array)
.and.have.lengthOf(1);

file.eslint.messages[0]
.should.have.properties('message', 'line', 'column')
.and.have.property('ruleId', 'arrow-parens');
.and.have.property('ruleId', 'prefer-template');

done();
})
.end(new File({
path: 'test/fixtures/es6.js',
contents: new Buffer('(a=>`${a}b`)("a");')
path: 'test/fixtures/stage0-class-property.js',
contents: new Buffer('class MyClass {prop = a + "b" + c;}')
}));
});

Expand Down

0 comments on commit 08b9212

Please sign in to comment.