Skip to content

Commit

Permalink
Update tests to avoid a regression in ESLint's source-fixer;
Browse files Browse the repository at this point in the history
  • Loading branch information
adametry committed Nov 10, 2015
1 parent 7e8c826 commit 4cb6145
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/linting.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ describe('gulp-eslint plugin', function() {
describe('"fix" option', function() {

it('when true, should update buffered contents', function(done) {
eslint({fix: true, rules: {'no-extra-semi': 1, 'no-trailing-spaces': 2}})
eslint({fix: true, useEslintrc: false, rules: {'no-trailing-spaces': 2}})
.on('error', done)
.on('data', function(file) {
should.exist(file);
Expand All @@ -239,23 +239,23 @@ describe('gulp-eslint plugin', function() {
})
.end(new File({
path: 'test/fixtures/fixable.js',
contents: new Buffer('var x = 0;; ')
contents: new Buffer('var x = 0; ')
}));
});

it('when true, should update stream contents', function(done) {
eslint({fix: true, rules: {'no-extra-semi': 1, 'no-trailing-spaces': 2}})
eslint({fix: true, useEslintrc: false, rules: {'no-trailing-spaces': 2}})
.on('error', done)
.on('data', function(file) {
should.exist(file);
should.exist(file.eslint);
file.eslint.messages.should.be.instanceof(Array).and.have.lengthOf(0);
file.eslint.errorCount.should.equal(0);
file.eslint.warningCount.should.equal(0);
file.eslint.output.should.equal('var x = 0;');
file.eslint.output.should.equal('var x = 0;;');
file.contents = file.contents.pipe(new BufferStreams(function(err, buf, cb) {
cb(err, buf);
buf.toString().should.equal('var x = 0;');
buf.toString().should.equal('var x = 0;;');
done();
}));

Expand Down

0 comments on commit 4cb6145

Please sign in to comment.