forked from yargalot/AccessSniff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
102 lines (79 loc) · 1.87 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
module.exports = function(grunt) {
// Time Grunt
require('time-grunt')(grunt);
// Load Development scripts
require('load-grunt-tasks')(grunt, {
scope: 'devDependencies'
});
grunt.initConfig({
// Clean
// ------------------------
clean: {
tests: ['reports']
},
// Js Hint
// ------------------------
jshint: {
all: ['src/*.js'],
options: {
jshintrc: '.jshintrc'
}
},
jscs: {
main: [ "src/*.js" ]
},
// Uglify
// ------------------------
uglify: {
dev: {
options: {
beautify : true,
mangle: false
},
files: {
'libs/dist/HTMLCS.min.js': [
'libs/HTML_CodeSniffer/Standards/**/*.js',
'libs/HTML_CodeSniffer/HTMLCS.js',
'src/runner.js'
]
}
},
dist: {
files: '<%= uglify.dev.files %>'
}
},
// Executables
// ------------------------
exec: {
testJson: {
cmd: 'sniff test/**/*.html -r json -l reports'
},
testCsv: {
cmd: 'sniff test/**/*.html -r csv -l reports'
},
testTxt: {
cmd: 'sniff test/**/*.html -r txt -l reports'
},
testUrl: {
cmd: 'sniff http://statamic.com/ -r json -l reports'
}
},
// Unit tests
// ------------------------
nodeunit: {
tests: ['test/*.js']
},
// Watch
// ------------------------
watch: {
jshint: {
files: 'src/**/*.js',
tasks: ['jshint', 'exec']
},
}
});
grunt.registerTask('dev', ['jshint', 'uglify:dev', 'watch']);
grunt.registerTask('test', ['clean:tests', 'uglify:dev', 'exec', 'nodeunit', 'jshint', 'jscs']);
// By default, lint and run all tests.
grunt.registerTask('default', ['clean:tests', 'exec', 'jshint', 'nodeunit', 'watch']);
};