-
Notifications
You must be signed in to change notification settings - Fork 46
/
Gruntfile.js
91 lines (86 loc) · 2.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
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
var grunt = require('grunt');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-js-beautify');
grunt.initConfig({
jshint: {
options: {
'node': true,
'esversion': 6,
},
all: ['routes/**/*.js',
'utils/**/*.js',
'views/**/*.js',
'public/static/scripts/**/*.js',
'Gruntfile.js',
'app.js',
'config.js',
'package.json',
'tools/destroy-and-rebuild-database',
'tools/manage-user',
'tools/migrate',
'tools/cat-user',
'tools/cat-registration',
'tools/add-to-cart',
'bin/www',
],
},
js_beautify: {
options: {
"end_with_newline": true,
"indent_size": 1,
"indent_char": " ",
"eol": "\n",
"indent_with_tabs": true,
"preserve_newlines": true,
"max_preserve_newlines": 10,
"jslint_happy": false,
},
files: ['routes/**/*.js',
'utils/**/*.js',
'views/**/*.js',
'public/static/scripts/**/*.(!home).js',
'Gruntfile.js',
'app.js',
'config.js',
'tools/destroy-and-rebuild-database',
'tools/manage-user',
'tools/migrate',
'tools/cat-user',
'tools/add-to-cart',
'bin/www',
]
},
mochaTest: {
test: {
options: {
reporter: 'spec',
timeout: 10000,
//captureFile: 'results.txt', // Optionally capture the reporter output to a file
quiet: false, // Optionally suppress output to standard out (defaults to false)
clearRequireCache: true // Optionally clear the require cache before running tests (defaults to false)
},
src: ['tests/**/*.js']
}
}
});
//grunt.registerTask('world', 'world task description', function() {
// console.log('hello world');
//});
grunt.registerTask('doc', 'generates static markdown documentation', function () {
require('mdoc').run({
// configuration options (specified below)
inputDir: 'docs',
outputDir: 'dist'
});
});
//grunt.registerTask('hello', 'say hello', function (name) {
// if (!name || !name.length)
// grunt.warn('you need to provide a name.');
//
// console.log('hello ' + name);
//});
//grunt.registerTask('default', ['jshint', 'mochaTest', 'js_beautify:files:all']);
grunt.registerTask('default', ['jshint', 'js_beautify:files:all']);
grunt.registerTask('test', ['jshint', 'mochaTest']);
grunt.registerTask('beautify', ['js_beautify:files:all']);