fix: noproxy (#3259)

close #3258
This commit is contained in:
Zoltan Kochan
2021-03-18 21:31:53 +02:00
committed by Zoltan Kochan
parent 2fe4ba9544
commit 4b3852c393
3 changed files with 19 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/config": patch
---
The noproxy setting should work.

View File

@@ -390,7 +390,7 @@ export default async (
pnpmConfig.httpProxy = pnpmConfig.httpsProxy ?? getProcessEnv('http_proxy') ?? getProcessEnv('proxy')
}
if (!pnpmConfig.noProxy) {
pnpmConfig.noProxy = getProcessEnv('no_proxy')
pnpmConfig.noProxy = pnpmConfig['noproxy'] ?? getProcessEnv('no_proxy')
}
pnpmConfig.enablePnp = pnpmConfig['nodeLinker'] === 'pnp'

View File

@@ -656,3 +656,16 @@ test('warn user unknown settings in npmrc', async () => {
expect(noWarnings).toStrictEqual([])
})
test('getConfig() converts noproxy to noProxy', async () => {
const { config } = await getConfig({
cliOptions: {
noproxy: 'www.foo.com',
},
packageManager: {
name: 'pnpm',
version: '1.0.0',
},
})
expect(config.noProxy).toBe('www.foo.com')
})