Skip to content

Commit

Permalink
test: use separate session to avoid conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Feb 7, 2020
1 parent 13c497a commit e5d9b99
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec-main/api-web-request-spec.ts
Expand Up @@ -382,6 +382,9 @@ describe('webRequest module', () => {
await new Promise(resolve => server.listen(0, '127.0.0.1', resolve))
const port = String((server.address() as AddressInfo).port)

// Use a separate session for testing.
const ses = session.fromPartition('WebRequestWebSocket')

// Setup listeners.
const receivedHeaders : { [key: string] : any } = {}
ses.webRequest.onBeforeSendHeaders((details, callback) => {
Expand Down Expand Up @@ -417,6 +420,7 @@ describe('webRequest module', () => {
})

const contents = (webContents as any).create({
session: ses,
nodeIntegration: true,
webSecurity: false
})
Expand Down

0 comments on commit e5d9b99

Please sign in to comment.