forked from mock-server/mockserver-client-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
85 lines (79 loc) · 2.46 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
/*
* mockserver
* http://mock-server.com
*
* Copyright (c) 2014 James Bloom
* Licensed under the Apache License, Version 2.0
*/
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
exec: {
stop_existing_mockservers: './stop_MockServer.sh'
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
user_defaults: [
'Gruntfile.js',
'js/**/*.js',
'!js/lib/**/*.js',
'<%= nodeunit.no_proxy %>',
'<%= nodeunit.with_proxy %>'
]
},
start_mockserver: {
options: {
serverPort: 1080,
proxyPort: 1090,
systemProperties: "-Dmockserver.enableCORSForAllResponses=true"
}
},
stop_mockserver: {
options: {
serverPort: 1080,
proxyPort: 1090
}
},
nodeunit: {
no_proxy: [
'test/no_proxy/*_test.js'
],
with_proxy: [
'test/with_proxy/*_test.js'
],
options: {
reporter: 'nested'
}
},
karma: {
options: {
configFile: 'test/karma.conf.js',
logLevel: 'INFO',
reporters: 'spec',
browserDisconnectTimeout: 10 * 10000,
browserNoActivityTimeout: 10 * 10000,
singleRun: true,
files: [
'mockServerClient.js',
'proxyClient.js',
'test/no_proxy/mock_server_browser_client_spec.js'
]
},
chrome: {
browsers: ['Chrome']
}
}
});
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('mockserver-node');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('test_node', ['start_mockserver', 'nodeunit', 'stop_mockserver']);
grunt.registerTask('test_browser', ['start_mockserver', 'karma:chrome', 'stop_mockserver']);
grunt.registerTask('test', ['start_mockserver', 'nodeunit', 'karma:chrome', 'stop_mockserver']);
grunt.registerTask('default', ['exec:stop_existing_mockservers', 'jshint', 'test']);
};