/
gruntfile.js
140 lines (135 loc) · 2.1 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/* eslint-disable quote-props */
'use strict';
module.exports = grunt => {
grunt.initConfig({
simplemocha: {
test: {
src: 'test/test.js'
}
},
watch: {
test: {
files: [
'noop'
]
}
},
php: {
open: {
options: {
port: 7007,
base: 'test',
keepAlive: true,
open: true
}
},
openUrl: {
options: {
port: 7008,
base: 'test',
keepAlive: true,
open: '200/index2.php'
}
},
test200: {
options: {
port: 8008,
base: 'test/200'
}
},
test301: {
options: {
port: 8009,
base: 'test/301'
}
},
test400: {
options: {
port: 8010,
base: 'test/400'
}
},
test404: {
options: {
port: 8011,
base: 'test/404'
}
},
test500: {
options: {
port: 8020,
base: 'test/500'
}
},
testEnv: {
options: {
port: 8021,
base: 'test/env',
env: {
FOOBAR: 'foobar'
}
}
},
testDirectives: {
options: {
port: 8022,
base: 'test/directives',
directives: {
'error_log': 'foobar'
}
}
},
serve: {
options: {
port: 9000,
base: 'test/browsersync'
}
}
},
browserSync: {
serve: {
bsFiles: {
src: [
'test/browsersync/styles.css',
'test/browsersync/index.php'
]
},
options: {
proxy: '<%= php.serve.options.hostname %>:<%= php.serve.options.port %>',
watchTask: true,
notify: true,
open: true,
logLevel: 'silent',
ghostMode: {
clicks: true,
scroll: true,
links: true,
forms: true
}
}
}
}
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-browser-sync');
grunt.registerTask('phpwatch', [
'php:test200',
'watch'
]);
grunt.registerTask('serve', [
'php:serve',
'browserSync:serve',
'watch'
]);
grunt.registerTask('default', [
'php:test200',
'php:test301',
'php:test400',
'php:test404',
'php:testEnv',
'php:testDirectives',
'simplemocha:test'
]);
};