forked from gruntjs/grunt-contrib-jasmine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
144 lines (138 loc) · 3.71 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
137
138
139
140
141
142
143
144
/*
* grunt-contrib-jasmine
* http://gruntjs.com/
*
* Copyright (c) 2016 GruntJS Team
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
connect: {
return500: {
options: {
port: 10921,
middleware: function() {
return [function(req, res) {
res.statusCode = 500;
res.end();
}];
}
}
}
},
eslint: {
all: [
'Gruntfile.js',
'tasks/**/*.js',
'test/*.js'
],
options: {
configFile: '.eslintrc'
}
},
watch: {
dev: {
files: ['tasks/**/*'],
tasks: ['jasmine:pivotal:build']
}
},
jasmine: {
pivotal: {
src: 'test/fixtures/pivotal/src/**/*.js',
options: {
specs: 'test/fixtures/pivotal/spec/*Spec.js',
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
summary: true,
junit: {
path: 'junit'
},
display: 'full'
}
},
consoleDisplayOptions: {
src: 'test/fixtures/pivotal/src/**/*.js',
options: {
specs: 'test/fixtures/pivotal/spec/*Spec.js',
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
display: 'short',
summary: true
}
},
consoleDisplayOptionsNone: {
src: 'test/fixtures/pivotal/src/**/*.js',
options: {
specs: 'test/fixtures/pivotal/spec/*Spec.js',
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
display: 'none',
summary: true
}
},
deepOutfile: {
src: 'test/fixtures/pivotal/src/**/*.js',
options: {
specs: 'test/fixtures/pivotal/spec/*Spec.js',
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
outfile: 'tmp/spec.html'
}
},
externalVendor: {
src: 'test/fixtures/externalVendor/src/**/*.js',
options: {
specs: 'test/fixtures/externalVendor/spec/**/*.js',
vendor: 'http://code.jquery.com/jquery-1.10.1.min.js'
}
},
// @todo: automate fail case here
// syntaxError: {
// src: 'test/fixtures/syntaxError/src/**/*.js',
// options: {
// specs: 'test/fixtures/syntaxError/spec/**/*.js'
// }
// },
customTemplate: {
src: 'test/fixtures/pivotal/src/**/*.js',
options: {
specs: 'test/fixtures/pivotal/spec/*Spec.js',
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
template: 'test/fixtures/customTemplate/custom.tmpl',
junit: {
path: 'junit/customTemplate',
consolidate: true
}
}
},
customTempDir: {
src: 'test/fixtures/custom-temp-dir/src/**/*.js',
options: {
specs: 'test/fixtures/custom-temp-dir/spec/**/*.js',
tempDir: '.custom/'
}
},
version25: {
options: {
specs: 'test/fixtures/versions/spec/SpecVersion25.js',
version: '2.5.2'
}
},
version31: {
options: {
specs: 'test/fixtures/versions/spec/SpecVersion31.js',
version: '3.1.0',
summary: true
}
}
},
nodeunit: {
tasks: ['test/*_test.js']
}
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-internal');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('test', ['connect:return500', 'jasmine', 'nodeunit', 'eslint']);
grunt.registerTask('default', ['test', 'build-contrib']);
};