Skip to content

Commit 9e165e5

Browse files
committed
[JS] Code cleanup update npm deps to latest
1 parent 6222ac0 commit 9e165e5

File tree

6 files changed

+115
-139
lines changed

6 files changed

+115
-139
lines changed

javascript/node/selenium-webdriver/common/driverFinder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ function getPath(service, capabilities) {
3232
try {
3333
return pathExists(service.getExecutable()) || driverLocation(capabilities)
3434
} catch (e) {
35-
throw Error(
36-
`Unable to obtain browser driver.
35+
throw Error(
36+
`Unable to obtain browser driver.
3737
For more information on how to install drivers see
3838
https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/. ${e}`
39-
)
39+
)
4040
}
4141
}
4242

javascript/node/selenium-webdriver/common/seleniumManager.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,22 @@ function driverLocation(options) {
7676
)
7777
}
7878

79-
console.log('Applicable driver not found; attempting to install with Selenium Manager (Beta)')
79+
console.log(
80+
'Applicable driver not found; attempting to install with Selenium Manager (Beta)'
81+
)
8082

8183
let args = ['--browser', options.getBrowserName(), '--output', 'json']
8284

83-
if (options.getBrowserVersion() && options.getBrowserVersion() !== "") {
84-
args.push("--browser-version", options.getBrowserVersion())
85+
if (options.getBrowserVersion() && options.getBrowserVersion() !== '') {
86+
args.push('--browser-version', options.getBrowserVersion())
8587
}
8688

87-
const vendorOptions = options.get('goog:chromeOptions') || options.get('ms:edgeOptions')
88-
|| options.get('moz:firefoxOptions')
89-
if (vendorOptions && vendorOptions.binary && vendorOptions.binary !== "") {
90-
args.push("--browser-path", '"' + vendorOptions.binary + '"')
89+
const vendorOptions =
90+
options.get('goog:chromeOptions') ||
91+
options.get('ms:edgeOptions') ||
92+
options.get('moz:firefoxOptions')
93+
if (vendorOptions && vendorOptions.binary && vendorOptions.binary !== '') {
94+
args.push('--browser-path', '"' + vendorOptions.binary + '"')
9195
}
9296

9397
const smBinary = getBinary()
@@ -106,15 +110,18 @@ function driverLocation(options) {
106110
errorMessage = e.toString()
107111
}
108112
}
109-
throw new Error(`Error executing command for ${smBinary} with ${args}: ${errorMessage}`)
113+
throw new Error(
114+
`Error executing command for ${smBinary} with ${args}: ${errorMessage}`
115+
)
110116
}
111117
try {
112118
output = JSON.parse(spawnResult.stdout.toString())
113119
} catch (e) {
114-
throw new Error(`Error executing command for ${smBinary} with ${args}: ${e.toString()}`)
120+
throw new Error(
121+
`Error executing command for ${smBinary} with ${args}: ${e.toString()}`
122+
)
115123
}
116124

117-
118125
for (const key in output.logs) {
119126
if (output.logs[key].level === 'WARN') {
120127
console.warn(`${output.logs[key].message}`)

javascript/node/selenium-webdriver/edge.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ class Options extends chromium.Options {
137137
* @param {boolean} enable flag to enable or disable the 'webview2' usage
138138
*/
139139
useWebView(enable) {
140-
const browserName = enable ? 'webview2' : Browser.EDGE;
141-
return this.setBrowserName(browserName);
140+
const browserName = enable ? 'webview2' : Browser.EDGE
141+
return this.setBrowserName(browserName)
142142
}
143143
}
144144

javascript/node/selenium-webdriver/io/exec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ function exec(command, opt_options) {
141141
resolve(new Result(code, signal))
142142
})
143143

144-
proc.once('error', err => {
145-
reject(err);
144+
proc.once('error', (err) => {
145+
reject(err)
146146
})
147147
})
148148
return new Command(result, killCommand)

0 commit comments

Comments
 (0)