Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
bec0eb21
Commit
bec0eb21
authored
7 years ago
by
XhmikosR
Browse files
Options
Download
Email Patches
Plain Diff
ES6-ify build/saucelabs-unit-test.js.
parent
210bb221
6 merge requests
!28721
Hot test
,
!27561
Adds font-weight-medium to font weight classes
,
!25494
web pack
,
!25326
Adjust examples
,
!23207
#22402 : modal: new autofocus & keyboardBtnNav options
,
!17021
v4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build/saucelabs-unit-test.js
+13
-12
build/saucelabs-unit-test.js
with
13 additions
and
12 deletions
+13
-12
build/saucelabs-unit-test.js
+
13
-
12
View file @
bec0eb21
const
JSUnitSaucelabs
=
require
(
'
jsunitsaucelabs
'
)
const
JSUnitSaucelabs
=
require
(
'
jsunitsaucelabs
'
)
var
jsUnitSaucelabs
=
new
JSUnitSaucelabs
({
const
jsUnitSaucelabs
=
new
JSUnitSaucelabs
({
username
:
process
.
env
.
SAUCE_USERNAME
,
username
:
process
.
env
.
SAUCE_USERNAME
,
password
:
process
.
env
.
SAUCE_ACCESS_KEY
password
:
process
.
env
.
SAUCE_ACCESS_KEY
})
})
...
@@ -8,17 +8,18 @@ var jsUnitSaucelabs = new JSUnitSaucelabs({
...
@@ -8,17 +8,18 @@ var jsUnitSaucelabs = new JSUnitSaucelabs({
// TODO : get all the browsers in sauce_browsers.yml
// TODO : get all the browsers in sauce_browsers.yml
var
testURL
=
'
http://localhost:3000/js/tests/index.html?hidepassed
'
const
testURL
=
'
http://localhost:3000/js/tests/index.html?hidepassed
'
jsUnitSaucelabs
.
start
([
jsUnitSaucelabs
.
start
([
[
'
Windows 8
'
,
'
internet explorer
'
,
'
10
'
]
[
'
Windows 8
'
,
'
internet explorer
'
,
'
10
'
]
],
testURL
,
'
qunit
'
,
function
(
error
,
success
)
{
],
testURL
,
'
qunit
'
,
(
error
,
success
)
=>
{
if
(
typeof
success
!==
'
undefined
'
)
{
if
(
typeof
success
!==
'
undefined
'
)
{
var
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 SauceLabs API
'
)
}
}
var
waitingCallback
=
function
(
error
,
success
)
{
const
waitingCallback
=
(
error
,
success
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
error
(
error
)
console
.
error
(
error
)
return
return
...
@@ -28,20 +29,20 @@ jsUnitSaucelabs.start([
...
@@ -28,20 +29,20 @@ jsUnitSaucelabs.start([
if
(
!
success
.
completed
)
{
if
(
!
success
.
completed
)
{
jsUnitSaucelabs
.
getStatus
(
taskIds
[
0
],
waitingCallback
)
jsUnitSaucelabs
.
getStatus
(
taskIds
[
0
],
waitingCallback
)
}
else
{
}
else
{
var
test
=
success
[
'
js tests
'
][
0
]
const
test
=
success
[
'
js tests
'
][
0
]
var
passed
=
false
let
passed
=
false
if
(
test
.
result
!==
null
)
{
if
(
test
.
result
!==
null
)
{
passed
=
test
.
result
.
total
===
test
.
result
.
passed
passed
=
test
.
result
.
total
===
test
.
result
.
passed
}
}
console
.
log
(
'
Tested
'
+
testURL
)
console
.
log
(
`
Tested
${
testURL
}
`
)
console
.
log
(
'
Platform:
'
+
test
.
platform
.
join
(
'
,
'
))
console
.
log
(
`
Platform:
${
test
.
platform
.
join
(
'
,
'
)
}
`
)
console
.
log
(
'
Passed:
'
+
passed
.
toString
())
console
.
log
(
`
Passed:
${
passed
.
toString
()
}
`
)
console
.
log
(
'
Url
'
+
test
.
url
)
console
.
log
(
`
Url
${
test
.
url
}
`
)
}
}
}
}
}
}
taskIds
.
forEach
(
function
(
id
)
{
taskIds
.
forEach
((
id
)
=>
{
jsUnitSaucelabs
.
getStatus
(
id
,
waitingCallback
)
jsUnitSaucelabs
.
getStatus
(
id
,
waitingCallback
)
})
})
}
}
...
...
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
Menu
Explore
Projects
Groups
Snippets