Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
7b514f48
Commit
7b514f48
authored
7 years ago
by
XhmikosR
Browse files
Options
Download
Email Patches
Plain Diff
Rename variables and remove unneeded return.
parent
874fd5b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build/saucelabs-unit-test.js
+9
-8
build/saucelabs-unit-test.js
with
9 additions
and
8 deletions
+9
-8
build/saucelabs-unit-test.js
+
9
-
8
View file @
7b514f48
...
@@ -17,13 +17,12 @@ const jsUnitSaucelabs = new JSUnitSaucelabs({
...
@@ -17,13 +17,12 @@ const jsUnitSaucelabs = new JSUnitSaucelabs({
const
testURL
=
'
http://localhost:3000/js/tests/index.html?hidepassed
'
const
testURL
=
'
http://localhost:3000/js/tests/index.html?hidepassed
'
const
browsersFile
=
require
(
path
.
resolve
(
__dirname
,
'
./sauce_browsers.json
'
))
const
browsersFile
=
require
(
path
.
resolve
(
__dirname
,
'
./sauce_browsers.json
'
))
let
jobsDone
=
0
let
jobsDone
=
0
let
jobsSucce
ss
=
0
let
jobsSucce
eded
=
0
const
waitingCallback
=
(
error
,
body
,
id
)
=>
{
const
waitingCallback
=
(
error
,
body
,
id
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
error
(
error
)
console
.
error
(
error
)
process
.
exit
(
1
)
process
.
exit
(
1
)
return
}
}
if
(
typeof
body
!==
'
undefined
'
)
{
if
(
typeof
body
!==
'
undefined
'
)
{
...
@@ -55,14 +54,14 @@ const waitingCallback = (error, body, id) => {
...
@@ -55,14 +54,14 @@ const waitingCallback = (error, body, id) => {
}
}
if
(
passed
)
{
if
(
passed
)
{
jobsSucce
ss
++
jobsSucce
eded
++
}
}
jobsDone
++
jobsDone
++
// Exit
// Exit
if
(
jobsDone
===
browsersFile
.
length
-
1
)
{
if
(
jobsDone
===
browsersFile
.
length
-
1
)
{
jsUnitSaucelabs
.
stop
()
jsUnitSaucelabs
.
stop
()
process
.
exit
(
jobsDone
===
jobsSucce
ss
?
0
:
1
)
process
.
exit
(
jobsDone
===
jobsSucce
eded
?
0
:
1
)
}
}
}
}
}
}
...
@@ -70,14 +69,15 @@ const waitingCallback = (error, body, id) => {
...
@@ -70,14 +69,15 @@ const waitingCallback = (error, body, id) => {
jsUnitSaucelabs
.
on
(
'
tunnelCreated
'
,
()
=>
{
jsUnitSaucelabs
.
on
(
'
tunnelCreated
'
,
()
=>
{
browsersFile
.
forEach
((
tmpBrowser
)
=>
{
browsersFile
.
forEach
((
tmpBrowser
)
=>
{
const
broPlatform
=
typeof
tmpBrowser
.
platform
===
'
undefined
'
?
tmpBrowser
.
platformName
:
tmpBrowser
.
platform
const
browsersPlatform
=
typeof
tmpBrowser
.
platform
===
'
undefined
'
?
tmpBrowser
.
platformName
:
tmpBrowser
.
platform
const
arrayBro
=
[
broPlatform
,
tmpBrowser
.
browserName
,
tmpBrowser
.
version
]
const
browsersArray
=
[
browsersPlatform
,
tmpBrowser
.
browserName
,
tmpBrowser
.
version
]
jsUnitSaucelabs
.
start
([
arrayBro
],
testURL
,
'
qunit
'
,
(
error
,
success
)
=>
{
jsUnitSaucelabs
.
start
([
browsersArray
],
testURL
,
'
qunit
'
,
(
error
,
success
)
=>
{
if
(
typeof
success
!==
'
undefined
'
)
{
if
(
typeof
success
!==
'
undefined
'
)
{
const
taskIds
=
success
[
'
js tests
'
]
const
taskIds
=
success
[
'
js tests
'
]
if
(
!
taskIds
||
!
taskIds
.
length
)
{
if
(
!
taskIds
||
!
taskIds
.
length
)
{
throw
new
Error
(
'
Error starting tests through SauceLabs API
'
)
throw
new
Error
(
'
Error starting tests through Sauce
Labs API
'
)
}
}
taskIds
.
forEach
((
id
)
=>
{
taskIds
.
forEach
((
id
)
=>
{
...
@@ -91,4 +91,5 @@ jsUnitSaucelabs.on('tunnelCreated', () => {
...
@@ -91,4 +91,5 @@ jsUnitSaucelabs.on('tunnelCreated', () => {
})
})
})
})
})
})
jsUnitSaucelabs
.
initTunnel
()
jsUnitSaucelabs
.
initTunnel
()
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment