Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions build/saucelabs-unit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const jsUnitSaucelabs = new JSUnitSaucelabs({

const testURL = 'http://localhost:3000/js/tests/index.html?hidepassed'
const browsersFile = require(path.resolve(__dirname, './sauce_browsers.json'))
const errorMessages = [
'Test exceeded maximum duration',
'Test exceeded maximum duration after 180 seconds'
]
let jobsDone = 0
let jobsSucceeded = 0

Expand All @@ -43,24 +47,25 @@ const waitingCallback = (error, body, id) => {
}, 2000)
} else {
const test = body['js tests'][0]
const platform = test.platform.join(', ')
let passed = false
let errorStr = false

if (test.result !== null) {
if (typeof test.result === 'string' && test.result === 'Test exceeded maximum duration') {
if (typeof test.result === 'string' && errorMessages.includes(test.result)) {
errorStr = test.result
} else {
passed = test.result.total === test.result.passed
}
}

console.log(`Tested ${testURL}`)
console.log(`Platform: ${test.platform.join(', ')}`)
console.log(`Passed: ${passed.toString()}`)
console.log(`Platform: ${platform}`)
console.log(`Passed: ${passed}`)
console.log(`URL: ${test.url}\n`)

if (errorStr) {
console.error(errorStr)
console.error(`${platform}: ${errorStr}`)
}

if (passed) {
Expand Down