Files
grafana/scripts/grunt/default_task.js
T

50 lines
1.0 KiB
JavaScript
Raw Normal View History

2013-11-14 16:07:14 -07:00
// Lint and build CSS
module.exports = function (grunt) {
2015-09-10 11:26:40 +02:00
'use strict';
grunt.registerTask('default', [
2017-10-01 20:02:25 +02:00
'clean:build',
'phantomjs',
'webpack:dev',
]);
grunt.registerTask('test', [
'sasslint',
2018-12-21 14:37:38 +01:00
'tslint',
'typecheck',
"exec:jest",
2017-10-01 20:02:25 +02:00
'no-only-tests'
2015-09-10 11:26:40 +02:00
]);
grunt.registerTask('tslint', [
'newer:exec:tslintPackages',
'newer:exec:tslintRoot',
]);
grunt.registerTask('typecheck', [
'newer:exec:typecheckPackages',
'newer:exec:typecheckRoot',
]);
2017-10-22 15:11:37 +02:00
grunt.registerTask('precommit', [
'newer:sasslint',
'typecheck',
'tslint',
2017-10-22 15:11:37 +02: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-30 22:46:39 -07:00
};