diff --git a/spec/api-session-spec.js b/spec/api-session-spec.js index a578f0dc4eb8..9a536b090e0a 100644 --- a/spec/api-session-spec.js +++ b/spec/api-session-spec.js @@ -562,6 +562,19 @@ describe('session module', () => { it('allows configuring proxy settings', (done) => { const config = { proxyRules: 'http=myproxy:80' } + customSession.setProxy(config, () => { + customSession.resolveProxy('http://example.com/', (proxy) => { + assert.strictEqual(proxy, 'PROXY myproxy:80') + done() + }) + }) + }) + + it('allows removing the implicit bypass rules for localhost', (done) => { + const config = { + proxyRules: 'http=myproxy:80', + proxyBypassRules: '<-loopback>' + } customSession.setProxy(config, () => { customSession.resolveProxy('http://localhost', (proxy) => { assert.strictEqual(proxy, 'PROXY myproxy:80') @@ -599,7 +612,7 @@ describe('session module', () => { proxyBypassRules: '' } customSession.setProxy(config, () => { - customSession.resolveProxy('http://localhost', (proxy) => { + customSession.resolveProxy('http://example/', (proxy) => { assert.strictEqual(proxy, 'DIRECT') done() })