-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add smoke-test to proxy live registry
Ref: #6760
- Loading branch information
1 parent
1c93c44
commit 42bef2c
Showing
5 changed files
with
173 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const t = require('tap') | ||
const setup = require('./fixtures/setup.js') | ||
const { createProxy } = require('proxy') | ||
const http = require('http') | ||
|
||
t.test('basic', async t => { | ||
const PORT = setup.PROXY_PORT | ||
const { npm, readFile } = await setup(t, { | ||
registry: false, | ||
testdir: { | ||
home: { | ||
'.npmrc': `proxy = "http://localhost:${PORT}/"`, | ||
}, | ||
}, | ||
}) | ||
|
||
const server = createProxy(http.createServer()) | ||
await new Promise(res => server.listen(PORT, res)) | ||
|
||
t.teardown(() => server.close()) | ||
|
||
await t.test('npm install prodDep@version', async t => { | ||
await npm('install', 'abbrev@1.0.4') | ||
|
||
t.strictSame(await readFile('package.json'), { | ||
dependencies: { abbrev: '^1.0.4' }, | ||
}) | ||
}) | ||
}) |