-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
44 lines (38 loc) · 1.19 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
module.exports = function (grunt) {
const alternativePort = '9517'
grunt.initConfig({
safaridriver: {
quiet: {},
verbose: { verbose: true, args: [`--port=${alternativePort}`] },
otherPort: { port: +alternativePort, findAvailablePort: true },
fail: { args: ['--invalid'] }
},
standard: {
all: {
src: [
'Gruntfile.js',
'tasks/**/*.js',
'<%= nodeunit.started %>',
'<%= nodeunit.stopped %>'
]
}
},
nodeunit: {
started: ['test/started.js'],
stopped: ['test/stopped.js']
}
})
grunt.loadNpmTasks('grunt-contrib-nodeunit')
grunt.loadTasks('tasks')
process.env.SAFARIDRIVER_PORT = undefined
grunt.registerTask('switchPort', 'Grunt task switching the safaridriver port.', function () {
process.env.SAFARIDRIVER_PORT = alternativePort
})
grunt.registerTask('default', [
'nodeunit:stopped', 'safaridriver:quiet:start',
'nodeunit:started', 'safaridriver:quiet:stop',
'nodeunit:stopped', 'safaridriver:verbose:start', 'switchPort',
'nodeunit:started', 'safaridriver:verbose:stop', 'nodeunit:stopped',
'safaridriver:otherPort:start', 'nodeunit:started'
])
}