This repository was archived by the owner on Feb 27, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.js
74 lines (72 loc) · 2.38 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
module.exports = function(grunt){
grunt.initConfig({
jshint: {
options: {
jshintrc:true // Use external jshinrc file configured as below
},
all: {
src: ['*/*.js'],
filter: function(filepath) { // on some developer machines the test coverage HTML report utilities cause further failures
if ((filepath.indexOf("coverage/") !== -1) || (filepath.indexOf("node_modules") !== -1)) {
console.log( "\033[30m filtered out \033[32m:\033[37m " + filepath + "\033[0m");
return false;
} else {
return true;
}
}
}
},
jsonlint:{
all:{
src:[
'*/locales/**/*.json'
]
}
},
inlinelint: {
html: ['*.html'],
options: {
jshintrc: ".jshintrc"
}
},
simplemocha: {
options: {
timeout: 3000
},
all: { src: ['test/*_spec.js'] }
},
mocha_istanbul: {
options: {
timeout: 60000,
ui: 'bdd',
reportFormats: ['lcov','html'],
print: 'both'
},
all: { src: ['test/*_spec.js'] }
},
nr_locales_htmllint: {
all: {
options: {
force: false,
"indent-width": false,
"tag-bans": [],
"attr-bans": [],
"link-req-noopener": false,
"spec-char-escape": false,
"line-no-trailing-whitespace": false
},
src: [
'./locales/**/*.html'
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-lint-inline');
grunt.loadNpmTasks('grunt-jsonlint');
grunt.loadNpmTasks("grunt-simple-mocha");
grunt.loadNpmTasks('grunt-mocha-istanbul');
grunt.loadNpmTasks('grunt-nr-locales-htmllint');
grunt.registerTask('default', ['jshint:all', 'jsonlint:all', 'inlinelint:html', "nr_locales_htmllint:all", "simplemocha:all"]);
grunt.registerTask('istanbul', ["mocha_istanbul:all"]);
};