mirror of
https://github.com/openstf/stf
synced 2025-10-05 10:39:25 +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]
|
return component.split('/', 1)[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
function processApp(app) {
|
function appReducer(acc, app) {
|
||||||
var packageName = pkg(app.component)
|
var packageName = pkg(app.component)
|
||||||
var browserId = mapping[packageName]
|
var browserId = mapping[packageName]
|
||||||
|
|
||||||
if (!browserId) {
|
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
|
id: app.component
|
||||||
, type: browserId
|
, type: browserId
|
||||||
, name: browsers[browserId].name
|
, name: browsers[browserId].name
|
||||||
, selected: app.selected
|
, selected: app.selected
|
||||||
, system: app.system
|
, system: app.system
|
||||||
}
|
})
|
||||||
|
|
||||||
|
return acc
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateBrowsers(data) {
|
function updateBrowsers(data) {
|
||||||
|
@ -55,9 +58,7 @@ module.exports = syrup.serial()
|
||||||
, wireutil.envelope(new wire.DeviceBrowserMessage(
|
, wireutil.envelope(new wire.DeviceBrowserMessage(
|
||||||
options.serial
|
options.serial
|
||||||
, data.selected
|
, data.selected
|
||||||
, data.apps.map(function(app) {
|
, data.apps.reduce(appReducer, [])
|
||||||
return new wire.DeviceBrowserAppMessage(processApp(app))
|
|
||||||
})
|
|
||||||
))
|
))
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue