forked from postalsys/emailengine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
57 lines (51 loc) · 1.65 KB
/
Gruntfile.js
File metadata and controls
57 lines (51 loc) · 1.65 KB
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
'use strict';
const config = require('@zone-eu/wild-config');
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
wait: {
server: {
options: {
delay: 20 * 1000 // Increased from 12s to 20s for Gmail API operations
}
}
},
shell: {
eslint: {
command: 'npx eslint lib/**/*.js workers/**/*.js server.js Gruntfile.js',
options: {
async: false
}
},
server: {
command: 'node server.js',
options: {
async: true
}
},
flush: {
command: `redis-cli -u "${config.dbs.redis}" flushdb`,
options: {
async: false
}
},
test: {
command: 'node --test --test-concurrency=1 --test-timeout=180000 test/*.js', // Added 3-minute timeout for tests
options: {
async: false
}
},
options: {
stdout: data => console.log(data.toString().trim()),
stderr: data => console.log(data.toString().trim()),
failOnError: true
}
}
});
// Load the plugin(s)
grunt.loadNpmTasks('grunt-shell-spawn');
grunt.loadNpmTasks('grunt-wait');
// Tasks
grunt.registerTask('test', ['shell:flush', 'shell:server', 'wait:server', 'shell:test', 'shell:server:kill']);
grunt.registerTask('default', ['shell:eslint', 'test']);
};