Skip to content

Commit

Permalink
Fix JS linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Mar 8, 2024
1 parent ffedae3 commit 3c05175
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AddInterceptParameters {
}

urlPattern(pattern) {
if (!pattern instanceof UrlPattern) {
if (!(pattern instanceof UrlPattern)) {
throw new Error(`Pattern must be an instance of UrlPattern. Received: '${pattern})'`)
}
this.#urlPatterns.push(Object.fromEntries(pattern.asMap()))
Expand All @@ -39,7 +39,7 @@ class AddInterceptParameters {

urlPatterns(patterns) {
patterns.forEach((pattern) => {
if (!pattern instanceof UrlPattern) {
if (!(pattern instanceof UrlPattern)) {
throw new Error(`Pattern must be an instance of UrlPattern. Received:'${pattern}'`)
}
this.#urlPatterns.push(Object.fromEntries(pattern.asMap()))
Expand All @@ -48,7 +48,7 @@ class AddInterceptParameters {
}

urlStringPattern(pattern) {
if (!pattern instanceof String) {
if (!(pattern instanceof String)) {
throw new Error(`Pattern must be an instance of String. Received:'${pattern}'`)
}

Expand All @@ -58,7 +58,7 @@ class AddInterceptParameters {

urlStringPatterns(patterns) {
patterns.forEach((pattern) => {
if (!pattern instanceof String) {
if (!(pattern instanceof String)) {
throw new Error(`Pattern must be an instance of String. Received:'${pattern}'`)
}
this.#urlPatterns.push({ type: 'string', pattern: pattern })
Expand Down
2 changes: 1 addition & 1 deletion javascript/node/selenium-webdriver/bidi/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Network {
}

async addIntercept(params) {
if (!params instanceof AddInterceptParameters) {
if (!(params instanceof AddInterceptParameters)) {
throw new Error(`Params must be an instance of AddInterceptParamenters. Received:'${params}'`)
}

Expand Down
2 changes: 0 additions & 2 deletions javascript/node/selenium-webdriver/bidi/urlPattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.

const { LocalValue } = require('./protocolValue')

class UrlPattern {
#map = new Map()

Expand Down
2 changes: 1 addition & 1 deletion javascript/node/selenium-webdriver/lib/test/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ exports.isDevMode = isDevMode
* @return {!Build} The new build.
* @throws {Error} If not running in dev mode.
*/
exports.of = function (var_args) {
exports.of = function (_) {
// eslint-disable-line
let targets = Array.prototype.slice.call(arguments, 0)
return new Build(targets)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

const assert = require('assert')
const firefox = require('../../firefox')
const { Browser, By, WebElement } = require('../../')
const { Browser } = require('../../')
const { suite } = require('../../lib/test')
const Network = require('../../bidi/network')
const { AddInterceptParameters } = require('../../bidi/addInterceptParameters')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

const assert = require('assert')
const firefox = require('../../firefox')
const { Browser, By, WebElement } = require('../../')
const { Browser, By } = require('../../')
const { Pages, suite } = require('../../lib/test')
const Network = require('../../bidi/network')
const { AddInterceptParameters } = require('../../bidi/addInterceptParameters')
Expand Down Expand Up @@ -92,7 +92,7 @@ suite(
await network.cancelAuth(event.request.request)
})
try {
const alert = await driver.wait(until.alertIsPresent(), 3000)
await driver.wait(until.alertIsPresent(), 3000)
assert.fail('Alert should not be present')
} catch (e) {
assert.strictEqual(e.name, 'TimeoutError')
Expand Down

0 comments on commit 3c05175

Please sign in to comment.