forked from nightwatchjs/nightwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
109 lines (92 loc) · 2.22 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
103
104
105
106
107
108
109
var nightwatch = require('./lib/index.js');
module.exports = function(grunt) {
'use strict';
nightwatch.initGrunt(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
jshintrc: '.jshintrc'
},
bin: {
src: 'bin/*.js'
},
lib: {
src: ['index.js', 'lib/**/*.js']
},
gruntfile: {
src: 'Gruntfile.js'
},
examples: {
src: [
'examples/*.js',
'examples/tests/**/*.js',
'examples/custom-commands/**/*.js'
]
}
},
jsonlint: {
src: ['tests/**/*.json', 'examples/**/*.json']
},
complexity: {
lib: {
src: ['lib/**/*.js'],
options: {
breakOnErrors: true,
errorsOnly: false,
cyclomatic: [12, 10, 8, 6, 4],
halstead: [30.19, 25, 20, 16, 12, 6, 3],
maintainability: 98.65, // should be 100+,
hideComplexFunctions: false
}
},
examples: {
src: ['examples/**/*.js'],
options: {
breakOnErrors: true,
errorsOnly: false,
cyclomatic: [12, 10, 8, 6, 4],
halstead: [30.19, 25, 20, 16, 12, 6, 3],
maintainability: 98.65, // should be 100+,
hideComplexFunctions: false
}
}
},
npmrelease: {
options: {
push: true,
bump : true,
pushTags: true,
npm: true,
silent : false,
commitMessage : 'bump version number to %s'
},
patch : {
}
},
nightwatch: {
options: {
cwd: './'
},
'default' : {
},
browserstack: {
argv: {
env: 'browserstack'
},
settings: {
silent: true
}
}
}
});
grunt.loadNpmTasks('grunt-npm-release');
grunt.loadNpmTasks('grunt-jsonlint');
grunt.loadNpmTasks('grunt-complexity');
// load the plugin that provides the "jshint" task.
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task(s).
grunt.registerTask('release', ['npmrelease']);
grunt.registerTask('default', ['jshint', 'jsonlint']);
grunt.registerTask('all', ['jshint', 'jsonlint', 'complexity']);
};