gulp-sass/test/lint.js
Sam Richard 8ca25e10ad Added linting
Linting modified from ibm-watson/runner for use in Node
2015-03-24 05:32:12 -05:00

50 lines
1.3 KiB
JavaScript

'use strict';
var eslint = require('eslint');
var should = require('should');
var cli = new eslint.CLIEngine();
var formatter = cli.getFormatter();
var report;
describe('style-guide', function() {
it('index.js should follow our lint style guide', function(done) {
report = cli.executeOnFiles(['index.js']);
if (report.errorCount > 0 || report.warningCount > 0) {
console.log(formatter(report.results));
}
should(report.errorCount).equal(0);
should(report.warningCount).equal(0);
done();
});
it('test/main.js should follow our lint style guide', function(done) {
report = cli.executeOnFiles(['test/main.js']);
if (report.errorCount > 0 || report.warningCount > 0) {
console.log(formatter(report.results));
}
should(report.errorCount).equal(0);
should(report.warningCount).equal(0);
done();
});
it('test/lint.js should follow our lint style guide', function(done) {
cli = new eslint.CLIEngine({
'rules': {
'no-console': 0
}
});
report = cli.executeOnFiles(['test/lint.js']);
if (report.errorCount > 0 || report.warningCount > 0) {
console.log(formatter(report.results));
}
should(report.errorCount).equal(0);
should(report.warningCount).equal(0);
done();
});
});