Skip to content

Commit

Permalink
[bidi][js] Enable add intercept parameters test
Browse files Browse the repository at this point in the history
  • Loading branch information
pujagani committed Apr 8, 2024
1 parent dc62d24 commit a3d4d14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class AddInterceptParameters {
* @throws {Error} - If the pattern is not an instance of String.
*/
urlStringPattern(pattern) {
if (!(pattern instanceof String)) {
if (typeof pattern !== 'string') {
throw new Error(`Pattern must be an instance of String. Received:'${pattern}'`)
}

Expand All @@ -84,7 +84,7 @@ class AddInterceptParameters {
*/
urlStringPatterns(patterns) {
patterns.forEach((pattern) => {
if (!(pattern instanceof String)) {
if (typeof pattern !== 'string') {
throw new Error(`Pattern must be an instance of String. Received:'${pattern}'`)
}
this.#urlPatterns.push({ type: 'string', pattern: pattern })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ suite(
})

describe('Add Intercept parameters test', function () {
xit('can add intercept phase', async function () {
it('can add intercept phase', async function () {
const network = await Network(driver)
const intercept = await network.addIntercept(new AddInterceptParameters(InterceptPhase.BEFORE_REQUEST_SENT))
assert.notEqual(intercept, null)
})

xit('can add intercept phases', async function () {
it('can add intercept phases', async function () {
const network = await Network(driver)
const intercept = await network.addIntercept(
new AddInterceptParameters(InterceptPhase.AUTH_REQUIRED, InterceptPhase.BEFORE_REQUEST_SENT),
)
assert.notEqual(intercept, null)
})

xit('can add string url pattern', async function () {
it('can add string url pattern', async function () {
const network = await Network(driver)
const intercept = await network.addIntercept(
new AddInterceptParameters(InterceptPhase.BEFORE_REQUEST_SENT).urlStringPattern(
Expand All @@ -63,7 +63,7 @@ suite(
assert.notEqual(intercept, null)
})

xit('can add string url patterns', async function () {
it('can add string url patterns', async function () {
const network = await Network(driver)
const intercept = await network.addIntercept(
new AddInterceptParameters(InterceptPhase.BEFORE_REQUEST_SENT).urlStringPatterns([
Expand All @@ -74,7 +74,7 @@ suite(
assert.notEqual(intercept, null)
})

xit('can add url pattern', async function () {
it('can add url pattern', async function () {
const network = await Network(driver)
const urlPattern = new UrlPattern().protocol('http').hostname('localhost').port(4444).pathname('basicAuth')
const intercept = await network.addIntercept(
Expand All @@ -83,7 +83,7 @@ suite(
assert.notEqual(intercept, null)
})

xit('can add url patterns', async function () {
it('can add url patterns', async function () {
const network = await Network(driver)
const urlPattern1 = new UrlPattern()
.protocol('http')
Expand Down

0 comments on commit a3d4d14

Please sign in to comment.