Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove 'electron' as known browser family during validation error. #6517

Merged
merged 4 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion packages/server/__snapshots__/3_config_spec.coffee.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,6 @@ Expected \`viewportWidth\` to be a number. Instead the value was: \`"foo"\`
exports['e2e config catches invalid browser in the configuration file 1'] = `
We found an invalid value in the file: \`cypress.json\`

Found an error while validating the \`browsers\` list. Expected \`family\` to be either electron, chromium or firefox. Instead the value was: \`{"name":"bad browser","family":"unknown family","displayName":"Bad browser","version":"no version","path":"/path/to","majorVersion":123}\`
Found an error while validating the \`browsers\` list. Expected \`family\` to be either chromium or firefox. Instead the value was: \`{"name":"bad browser","family":"unknown family","displayName":"Bad browser","version":"no version","path":"/path/to","majorVersion":123}\`

`
4 changes: 2 additions & 2 deletions packages/server/__snapshots__/validation_spec.coffee.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ exports['lib/util/validation #isValidBrowser passes valid browsers and forms err
{
"given": {
"name": "No display name",
"family": "electron"
"family": "chromium"
},
"expect": "Expected `displayName` to be a non-empty string. Instead the value was: `{\"name\":\"No display name\",\"family\":\"electron\"}`"
},
Expand All @@ -71,7 +71,7 @@ exports['lib/util/validation #isValidBrowser passes valid browsers and forms err
"displayName": "Bad family browser",
"family": "unknown family"
},
"expect": "Expected `family` to be either electron, chromium or firefox. Instead the value was: `{\"name\":\"bad family\",\"displayName\":\"Bad family browser\",\"family\":\"unknown family\"}`"
"expect": "Expected `family` to be either chromium or firefox. Instead the value was: `{\"name\":\"bad family\",\"displayName\":\"Bad family browser\",\"family\":\"unknown family\"}`"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/server/lib/util/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const isValidBrowser = (browser) => {
}

// TODO: this is duplicated with browsers/index
const knownBrowserFamilies = ['electron', 'chromium', 'firefox']
const knownBrowserFamilies = ['chromium', 'firefox']

if (!is.oneOf(knownBrowserFamilies)(browser.family)) {
return errMsg('family', browser, commaListsOr`either ${knownBrowserFamilies}`)
Expand Down
2 changes: 1 addition & 1 deletion packages/server/test/unit/config_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ describe "lib/config", ->
}
browserTwo = {
name: "fake electron",
family: "electron",
family: "chromium",
displayName: "Electron",
version: "x.y.z",
# Electron browser is built-in, no external path
Expand Down
2 changes: 1 addition & 1 deletion packages/server/test/unit/validation_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe "lib/util/validation", ->
# invalid browser, missing displayName
{
name: "No display name",
family: "electron"
family: "chromium"
},
{
name: "bad family",
Expand Down