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
diff options
context:
space:
mode:
-rw-r--r--tap-snapshots/test/lib/commands/publish.js.test.cjs4
-rw-r--r--test/lib/commands/publish.js27
2 files changed, 31 insertions, 0 deletions
diff --git a/tap-snapshots/test/lib/commands/publish.js.test.cjs b/tap-snapshots/test/lib/commands/publish.js.test.cjs
index 6a33b891e..f90cf3152 100644
--- a/tap-snapshots/test/lib/commands/publish.js.test.cjs
+++ b/tap-snapshots/test/lib/commands/publish.js.test.cjs
@@ -9,6 +9,10 @@ exports[`test/lib/commands/publish.js TAP _auth config default registry > new pa
+ test-package@1.0.0
`
+exports[`test/lib/commands/publish.js TAP bare _auth and registry config > new package version 1`] = `
++ @npm/test-package@1.0.0
+`
+
exports[`test/lib/commands/publish.js TAP dry-run > must match snapshot 1`] = `
Array [
Array [
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: {