forked from wesleytodd/YeoPress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
68 lines (59 loc) · 1.36 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
module.exports = function(grunt) {
// Configuration
grunt.initConfig({
clean: {
site: ['test/site/*', 'test/site/.*', '!test/site/.gitkeep'],
test: ['test/tmp'],
cache: {
options: {force: true},
src: [
// Wordpress
process.env.HOME + '/.yeoman/cache/wordpress',
// Yeopress default theme
process.env.HOME + 'wesleytodd/YeoPress'
]
}
},
connect: {
coverage: {
options: {
port: 9001,
keepalive: true,
base: 'test/coverage/lcov-report',
open: true
}
}
},
simplemocha: {
unit: {
src: ['test/unit/*.js']
}
}
});
// Run the test and generate the coverage report
grunt.registerTask('istanbul', function() {
var done = this.async();
require('child_process').exec('npm run-script test --coverage', function(err, stdout, stderr) {
console.error(stderr);
console.log(stdout);
console.log('\n\nView test coverage here:');
console.log('---------------------------');
console.log('http://localhost:9001');
done();
});
});
// Register composite tasks
grunt.util._({
'default': ['watch'],
'coverage': ['istanbul', 'connect:coverage']
}).map(function(task, name) {
grunt.registerTask(name, task);
});
// Register npm tasks
[
'grunt-contrib-clean',
'grunt-contrib-connect',
//'grunt-contrib-watch',
'grunt-simple-mocha'
].forEach(grunt.loadNpmTasks);
}