This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
gruntfile.js
65 lines (52 loc) · 1.31 KB
/
gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
'use strict';
module.exports = function (grunt) {
// tests
var match = false;
grunt.util.hooker.hook(process.stdout, 'write', function (str) {
if (/Total/.test(str)) {
match = true;
}
});
require('./')(grunt);
grunt.registerTask('test', function () {
setTimeout(this.async(), 1200);
});
grunt.registerTask('test2', function () {
setTimeout(this.async(), 900);
});
grunt.registerTask('This is a really long task name', function () {
setTimeout(this.async(), 21);
});
grunt.registerTask('This is the longest but very quick task name', function () {
setTimeout(this.async(), 1);
});
grunt.registerTask('This is a really long task name which is cropped in the middle', function () {
setTimeout(this.async(), 21);
});
grunt.registerTask('testsigint', function () {
this.async();
setTimeout(function () {
process.emit('SIGINT');
}, 21);
});
grunt.registerTask('watch', function () {
setTimeout(this.async(), 50);
});
grunt.registerTask('default', [
'test',
'test2',
'This is a really long task name',
'This is the longest but very quick task name',
'This is a really long task name which is cropped in the middle',
'watch'
]);
grunt.registerTask('sigint', [
'test',
'testsigint'
]);
process.on('exit', function () {
if (!match) {
process.exit(1);
}
});
};