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:
authorLuke Karrys <luke@lukekarrys.com>2022-04-11 22:25:06 +0300
committerNathan Fritz <fritzy@github.com>2022-04-14 00:30:39 +0300
commite992b4a21ecdd96aa33c59682c0ac0cc8a30d776 (patch)
treed800e3773133182ca97599989aa4083f65d113be
parent25450652240dc8e7e28e391313b93f0f27c6da19 (diff)
fixup! fix: show more information during publish dry-run
-rw-r--r--test/lib/commands/publish.js28
1 files changed, 18 insertions, 10 deletions
diff --git a/test/lib/commands/publish.js b/test/lib/commands/publish.js
index e266ea524..64eb7c60c 100644
--- a/test/lib/commands/publish.js
+++ b/test/lib/commands/publish.js
@@ -227,6 +227,18 @@ t.test(
),
})
+ const npm = mockNpm({
+ config: { 'dry-run': true, loglevel: 'info' },
+ output: () => {
+ t.pass('output fn is called')
+ },
+ }, t)
+ const registry = npm.config.get('registry')
+ npm.config.getCredentialsByURI = uri => {
+ t.same(uri, registry, 'gets credentials for expected registry')
+ return { /* no token will call log.warn */ }
+ }
+
const Publish = t.mock('../../../lib/commands/publish.js', {
'../../../lib/utils/tar.js': {
getContents: () => ({
@@ -235,6 +247,12 @@ t.test(
logTar: () => {
t.pass('logTar is called')
},
+ 'proc-log': {
+ warn (_, msg) {
+ t.match(msg,
+ `This command requires you to be logged in to ${registry} (dry-run)`)
+ },
+ },
},
libnpmpublish: {
publish: () => {
@@ -242,16 +260,6 @@ t.test(
},
},
})
- const npm = mockNpm({
- config: { 'dry-run': true, loglevel: 'info' },
- output: () => {
- t.pass('output fn is called')
- },
- }, t)
- npm.config.getCredentialsByURI = uri => {
- t.same(uri, npm.config.get('registry'), 'gets credentials for expected registry')
- return { token: 'some.registry.token' }
- }
const publish = new Publish(npm)