This repository has been archived by the owner on Feb 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathGruntfile.js
106 lines (101 loc) · 3.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/** @format */
module.exports = function( grunt ) {
// configure tasks
grunt.initConfig( {
shell: {
runTests: {
command: function( browserSize, sauceConfig ) {
// The run.sh script no longer supports this format with the switch to
// magellan as the test runner. For now just calling mocha directly
// until Grunt can be replaced with magellan entirely (Issue 508)
// return './run.sh -R -c -f -v -l ' + sauceConfig + ' -s ' + browserSize
return `env BROWSERSIZE=${ browserSize } ./node_modules/.bin/mocha --NODE_CONFIG='{"failVisdiffs":"true","sauce":"true","sauceConfig":"${ sauceConfig }"}' -R spec-xunit-reporter specs-visdiff/ || echo true`;
},
},
},
concurrent: {
all: {
tasks: [
'run_mobile_osx-firefox',
'run_desktop_osx-firefox',
'run_tablet_osx-firefox',
'run_mobile_osx-chrome',
'run_desktop_osx-chrome',
'run_tablet_osx-chrome',
'run_mobile_osx-safari',
'run_desktop_osx-safari',
'run_tablet_osx-safari',
'run_desktop_win-ie11',
],
options: {
limit: 3,
logConcurrentOutput: true,
},
},
notChrome: {
tasks: [
'run_mobile_osx-firefox',
'run_desktop_osx-firefox',
'run_tablet_osx-firefox',
'run_mobile_osx-safari',
'run_desktop_osx-safari',
'run_tablet_osx-safari',
'run_desktop_win-ie11',
],
options: {
limit: 3,
logConcurrentOutput: true,
},
},
firefox: {
tasks: [ 'run_mobile_osx-firefox', 'run_desktop_osx-firefox', 'run_tablet_osx-firefox' ],
options: {
limit: 3,
logConcurrentOutput: true,
},
},
chrome: {
tasks: [ 'run_mobile_osx-chrome', 'run_desktop_osx-chrome', 'run_tablet_osx-chrome' ],
options: {
limit: 3,
logConcurrentOutput: true,
},
},
safari: {
tasks: [ 'run_mobile_osx-safari', 'run_desktop_osx-safari', 'run_tablet_osx-safari' ],
options: {
limit: 3,
logConcurrentOutput: true,
},
},
ie11: {
tasks: [ 'run_desktop_win-ie11' ],
options: {
limit: 3,
logConcurrentOutput: true,
},
},
},
} );
// load tasks
grunt.loadNpmTasks( 'grunt-concurrent' );
grunt.loadNpmTasks( 'grunt-shell' );
// register tasks
grunt.registerTask( 'default', [ 'concurrent:all' ] );
grunt.registerTask( 'all', [ 'concurrent:all' ] );
grunt.registerTask( 'notChrome', [ 'concurrent:notChrome' ] );
grunt.registerTask( 'firefox', [ 'concurrent:firefox' ] );
grunt.registerTask( 'chrome', [ 'concurrent:chrome' ] );
grunt.registerTask( 'safari', [ 'concurrent:safari' ] );
grunt.registerTask( 'ie11', [ 'concurrent:ie11' ] );
grunt.registerTask( 'run_mobile_osx-chrome', [ 'shell:runTests:mobile:osx-chrome' ] );
grunt.registerTask( 'run_desktop_osx-chrome', [ 'shell:runTests:desktop:osx-chrome' ] );
grunt.registerTask( 'run_tablet_osx-chrome', [ 'shell:runTests:tablet:osx-chrome' ] );
grunt.registerTask( 'run_mobile_osx-firefox', [ 'shell:runTests:mobile:osx-firefox' ] );
grunt.registerTask( 'run_desktop_osx-firefox', [ 'shell:runTests:desktop:osx-firefox' ] );
grunt.registerTask( 'run_tablet_osx-firefox', [ 'shell:runTests:tablet:osx-firefox' ] );
grunt.registerTask( 'run_mobile_osx-safari', [ 'shell:runTests:mobile:osx-safari' ] );
grunt.registerTask( 'run_desktop_osx-safari', [ 'shell:runTests:desktop:osx-safari' ] );
grunt.registerTask( 'run_tablet_osx-safari', [ 'shell:runTests:tablet:osx-safari' ] );
grunt.registerTask( 'run_desktop_win-ie11', [ 'shell:runTests:desktop:win-ie11' ] );
};