grafana/scripts/grunt/default_task.js

39 lines
837 B
JavaScript
Raw Normal View History

2013-11-14 17:07:14 -06:00
// Lint and build CSS
module.exports = function (grunt) {
2015-09-10 04:26:40 -05:00
'use strict';
grunt.registerTask('default', [
'clean:build',
'phantomjs',
'webpack:dev',
]);
grunt.registerTask('test', [
'sasslint',
'exec:tslint',
"exec:jest",
'no-only-tests'
2015-09-10 04:26:40 -05:00
]);
2017-10-22 08:11:37 -05:00
grunt.registerTask('precommit', [
'sasslint',
'exec:tslint',
'exec:tsc',
2017-10-22 08:11:37 -05:00
'no-only-tests'
]);
grunt.registerTask('no-only-tests', function () {
var files = grunt.file.expand('public/**/*_specs\.ts', 'public/**/*_specs\.js');
files.forEach(function (spec) {
var rows = grunt.file.read(spec).split('\n');
rows.forEach(function (row) {
if (row.indexOf('.only(') > 0) {
grunt.log.errorlns(row);
grunt.fail.warn('found only statement in test: ' + spec)
}
});
});
});
2014-05-31 00:46:39 -05:00
};