forked from RallyCommunity/PICycleTime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
59 lines (51 loc) · 2.04 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
var module = module;
//this keeps the module file from doing anything inside the jasmine tests.
//We could avoid this by making all the source be in a specific directory, but that would break backwards compatibility.
if (module) {
module.exports = function (grunt) {
'use strict';
var config, debug, environment, spec, port;
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('test', ['jshint', 'jasmine']);
grunt.registerTask('default', ['test']);
grunt.registerTask('test:debug', ['jasmine:app:build', 'connect']);
spec = grunt.option('spec') || '*';
port = grunt.option('port') || 7357;
debug = grunt.option('debug') || false;
config = grunt.file.readJSON('config.json');
return grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jasmine: {
app: {
src: config.javascript,
options: {
styles: config.css,
vendor:[
'node_modules/rally-sdk2-test-utils/src/sdk/' + config.sdk + '/sdk-debug.js',
'node_modules/rally-sdk2-test-utils/dist/sdk2-test-utils.js'
],
template: 'node_modules/rally-sdk2-test-utils/lib/specs.tmpl',
specs: "test/**/" + spec + "Spec.js",
keepRunner: true
}
}
},
jshint: {
all: ['test/**/*.js']
},
connect: {
server: {
options: {
port: port,
open: {
target: 'http://localhost:' + port + '/_SpecRunner.html'
},
keepalive: true
}
}
}
});
};
}