Repository navigation
Expand file tree
/
Copy pathGruntfile.js
More file actions
105 lines (96 loc) · 2.95 KB
/
Copy pathGruntfile.js
File metadata and controls
105 lines (96 loc) · 2.95 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
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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
font: {
icons: {
src: ['app/public/fonts/svg-icons/*.svg'],
destCss: 'app/public/styles/less/icons.less',
destFonts: 'app/public/fonts/icons.woff',
// Optional: Custom routing of font filepaths for CSS
cssRouter: function (fontpath) {
var pathArray = fontpath.split('/');
var fileName = pathArray[pathArray.length - 1];
return '/public/fonts/' + fileName;
}
}
},
less: {
all: {
files: {
'app/public/styles/main.css': [ 'app/public/styles/less/main.less' ],
'app/public/styles/index.css': [ 'app/public/styles/less/index.less' ],
'app/public/styles/launchTest.css': [ 'app/public/styles/less/launchTest.less' ],
'app/public/styles/results.css': [ 'app/public/styles/less/results.less' ]
}
}
},
jshint: {
all: [
'*.js',
'app/lib/*',
'app/nodeControllers/*.js',
'app/public/scripts/*.js',
'phantomas_custom/**/*.js'
]
},
clean: {
icons: {
src: ['tmp']
},
coverage: {
src: ['coverage/']
}
},
copy: {
coverage: {
src: ['test/**'],
dest: 'coverage/'
}
},
blanket: {
coverage: {
src: ['app/'],
dest: 'coverage/app/'
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
},
src: ['coverage/test/server/*.js']
},
coverage: {
options: {
reporter: 'html-cov',
// use the quiet flag to suppress the mocha console output
quiet: true,
// specify a destination file to capture the mocha
// output (the quiet option does not suppress this)
captureFile: 'coverage/coverage.html'
},
src: ['coverage/test/server/*.js']
}
}
});
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('icons', [
'font:icons',
'less',
'clean:icons'
]);
grunt.registerTask('build', [
'jshint',
'less'
]);
grunt.registerTask('hint', [
'jshint'
]);
grunt.registerTask('test', [
'clean:coverage',
'blanket',
'copy:coverage',
'mochaTest'
]);
};