This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.js
136 lines (126 loc) · 2.9 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
module.exports = function(grunt) {
"use strict";
require( 'load-grunt-tasks' )( grunt );
grunt.initConfig({
clean: {
api_docs: [ 'docs/api/**' ],
dist: [ 'dist/' ]
},
jsdoc: {
src: ['lib/**/*.js', 'bin/*.js'],
options: {
destination: 'docs/api'
}
},
jsonlint: {
pkg: {
src: [
'package.json',
'test/server/data/fixtures/*.json',
'test/server/data/testConfig.json',
'docs/config.json'
]
}
},
jscs: {
main: [
'bin/*.js',
'lib/**/*.js'
],
options: {
config: '.jscsrc'
}
},
jshint: {
all: [
'Gruntfile.js',
'bin/*.js',
'lib/**/*.js',
'test/**/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
jasmine_nodejs: {
// task specific (default) options
options: {
specNameSuffix: "spec.js", // also accepts an array
helperNameSuffix: "helper.js",
useHelpers: false,
random: false,
seed: null,
defaultTimeout: 5000,
stopOnFailure: false,
traceFatal: 2,
// configure one or more built-in reporters
reporters: {
console: {
colors: true, // (0|false)|(1|true)|2
cleanStack: 0, // (0|false)|(1|true)|2|3
verbosity: 4, // (0|false)|1|2|3|(4|true)
listStyle: "indent", // "flat"|"indent"
activity: false
},
},
// add custom Jasmine reporter(s)
customReporters: []
},
'config_tests': {
specs: [ "test/*.js" ]
},
'server_tests': {
// target specific options
//options: {
// useHelpers: true
//},
// spec files
specs: [
"test/server/**"
]
//helpers: [
// "test/helpers/**"
//]
},
'client_tests': {
specs: [ "test/client/*.js" ]
},
'uiclient_tests': {
specs: [ "test/uiclient/*.js" ]
}
},
browserify: {
dist: {
files : {
'dist/npg_ranger_browser.js': [
'lib/main.js'
]
},
options: {
debug: true,
require: [ ['./lib/main.js', {expose: 'RangerRequest'} ] ]
}
}
},
watch: {
js: {
files: [
'Gruntfile.js',
'.jshintrc',
'.jscsrc',
'bin/**/*.js',
'lib/**/*.js',
'test/client/*.js'
],
tasks: [
'lint', 'test'
]
}
}
});
grunt.registerTask('lint', ['jshint', 'jscs', 'jsonlint']);
grunt.registerTask('jasmine', ['jasmine_nodejs']);
grunt.registerTask('test', ['lint', 'jasmine']);
grunt.registerTask('doc', ['clean:api_docs', 'jsdoc']);
grunt.registerTask('default', ['test']);
};