mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Ignore unknown browsers instead of refusing to start.
This commit is contained in:
parent
9defe97e07
commit
6e493c6178
1 changed files with 8 additions and 7 deletions
|
@ -31,21 +31,24 @@ module.exports = syrup.serial()
|
|||
return component.split('/', 1)[0]
|
||||
}
|
||||
|
||||
function processApp(app) {
|
||||
function appReducer(acc, app) {
|
||||
var packageName = pkg(app.component)
|
||||
var browserId = mapping[packageName]
|
||||
|
||||
if (!browserId) {
|
||||
throw new Error(util.format('Unmapped browser "%s"', packageName))
|
||||
log.warn('Unmapped browser "%s"', packageName)
|
||||
return acc
|
||||
}
|
||||
|
||||
return {
|
||||
acc.push({
|
||||
id: app.component
|
||||
, type: browserId
|
||||
, name: browsers[browserId].name
|
||||
, selected: app.selected
|
||||
, system: app.system
|
||||
}
|
||||
})
|
||||
|
||||
return acc
|
||||
}
|
||||
|
||||
function updateBrowsers(data) {
|
||||
|
@ -55,9 +58,7 @@ module.exports = syrup.serial()
|
|||
, wireutil.envelope(new wire.DeviceBrowserMessage(
|
||||
options.serial
|
||||
, data.selected
|
||||
, data.apps.map(function(app) {
|
||||
return new wire.DeviceBrowserAppMessage(processApp(app))
|
||||
})
|
||||
, data.apps.reduce(appReducer, [])
|
||||
))
|
||||
])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue