-
Notifications
You must be signed in to change notification settings - Fork 8
/
Gruntfile.js
53 lines (45 loc) · 1.26 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
module.exports = function(grunt) {
grunt.loadNpmTasks( "grunt-contrib-jshint" );
grunt.loadNpmTasks( "grunt-mocha-cli" );
grunt.initConfig({
jshint: {
options: {
jshintrc: ".jshintrc"
},
all: [ "lib/**/*.js", "standard/**/*.js", "test/*.js" ]
},
mochacli: {
test: {
options: {
reporter: "spec"
},
src: [ "test/unit-tests.js" ]
}
},
jscs: {
test: {
options: {
"standard": "Jquery"
},
all: [ "./lib", "./jscs-module.js" ]
}
}
});
grunt.registerMultiTask( 'jscs', 'Run jscs', function() {
var argv = [
"node",
"jscs",
( "--standard=" + grunt.task.current.data.options.standard || "Jquery" ),
"--report-full"
],
lArgv,
jscs = require( "./jscs-module" ),
folders = grunt.task.current.data.all;
lArgv = argv.concat( folders );
grunt.log.writeln( "Starting jscs on `" + folders.join( " " ) + "`" );
grunt.verbose.writeln( 'Exec: ' + lArgv.join(" ") );
jscs( lArgv, process.cwd() );
});
grunt.registerTask( "test", [ "jshint", "mochacli", "jscs" ] );
grunt.registerTask( "default", [ "test" ] );
};