2013-11-14 17:07:14 -06:00
|
|
|
// Lint and build CSS
|
2018-09-27 08:15:41 -05:00
|
|
|
module.exports = function (grunt) {
|
2015-09-10 04:26:40 -05:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
grunt.registerTask('default', [
|
2017-10-01 13:02:25 -05:00
|
|
|
'clean:build',
|
|
|
|
'phantomjs',
|
|
|
|
'webpack:dev',
|
|
|
|
]);
|
|
|
|
|
|
|
|
grunt.registerTask('test', [
|
|
|
|
'sasslint',
|
2017-04-20 04:26:30 -05:00
|
|
|
'exec:tslint',
|
2017-10-22 00:03:26 -05:00
|
|
|
"exec:jest",
|
2017-10-01 13:02:25 -05:00
|
|
|
'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',
|
2018-09-27 08:15:41 -05:00
|
|
|
'exec:tsc',
|
2017-10-22 08:11:37 -05:00
|
|
|
'no-only-tests'
|
|
|
|
]);
|
|
|
|
|
2018-09-27 08:15:41 -05:00
|
|
|
grunt.registerTask('no-only-tests', function () {
|
2016-04-18 10:12:53 -05:00
|
|
|
var files = grunt.file.expand('public/**/*_specs\.ts', 'public/**/*_specs\.js');
|
|
|
|
|
2018-09-27 08:15:41 -05:00
|
|
|
files.forEach(function (spec) {
|
2016-04-18 10:12:53 -05:00
|
|
|
var rows = grunt.file.read(spec).split('\n');
|
2018-09-27 08:15:41 -05:00
|
|
|
rows.forEach(function (row) {
|
2016-04-18 10:12:53 -05:00
|
|
|
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
|
|
|
};
|