forked from streetmix/streetmix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
57 lines (56 loc) · 1.54 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
var path = require('path')
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt)
grunt.initConfig({
env: {
test: {
NODE_ENV: 'test'
}
},
express: {
app: {
options: {
server: path.resolve(__dirname, 'app.js'),
port: process.env.PORT || 3000
}
}
},
protractor: {
local: {
options: {
configFile: './test/integration/local.conf.js',
keepAlive: true,
noColor: false,
args: {}
}
},
saucelabs: {
options: {
configFile: './test/integration/saucelabs.conf.js',
args: {
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY
}
}
}
},
shell: {
options: {
stderr: false
},
target: {
command: './node_modules/grunt-protractor-runner/scripts/webdriver-manager-update'
}
}
})
grunt.registerTask('test:travis', (
// Sauce-based tests cannot be performed on pull request open by user that
// doesn't have write permission to main repository
// https://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests
(process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY)
? ['env:test', 'express:app', 'protractor:saucelabs']
: ['env:test', 'express:app']
))
grunt.registerTask('test:local:setup', ['shell'])
grunt.registerTask('test:local', ['env:test', 'express:app', 'protractor:local'])
}