Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2022-04-21 17:38:08 +0300
committerLuke Karrys <luke@lukekarrys.com>2022-04-21 19:19:15 +0300
commit873ac7a6ebb41b5ff1e0907f57c5b7e73cc16f0c (patch)
treec0a21d107c49f068f6cd3cfaa613669665796667 /test
parent6cd6831eaa9e1681e07f6646e6f13cce344e1250 (diff)
chore(publish): add test for _auth with configured registry
Diffstat (limited to 'test')
-rw-r--r--test/lib/commands/publish.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/lib/commands/publish.js b/test/lib/commands/publish.js
index 885e82042..3cbe96238 100644
--- a/test/lib/commands/publish.js
+++ b/test/lib/commands/publish.js
@@ -626,6 +626,33 @@ t.test('_auth config default registry', async t => {
t.matchSnapshot(joinedOutput(), 'new package version')
})
+t.test('bare _auth and registry config', async t => {
+ const spec = npa('@npm/test-package')
+ const { npm, joinedOutput } = await loadMockNpm(t, {
+ config: {
+ registry: alternateRegistry,
+ _auth: basic,
+ },
+ prefixDir: {
+ 'package.json': JSON.stringify({
+ name: '@npm/test-package',
+ version: '1.0.0',
+ }, null, 2),
+ },
+ globals: ({ prefix }) => ({
+ 'process.cwd': () => prefix,
+ }),
+ })
+ const registry = new MockRegistry({
+ tap: t,
+ registry: alternateRegistry,
+ basic,
+ })
+ registry.nock.put(`/${spec.escapedName}`).reply(200, {})
+ await npm.exec('publish', [])
+ t.matchSnapshot(joinedOutput(), 'new package version')
+})
+
t.test('bare _auth config scoped registry', async t => {
const { npm } = await loadMockNpm(t, {
config: {