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:
authorLuke Karrys <luke@lukekarrys.com>2021-12-09 03:10:46 +0300
committernlf <quitlahok@gmail.com>2021-12-09 21:09:40 +0300
commit71777be17e57179d203cb9162664ecd0c36ca633 (patch)
tree22ad0c5c3cfc5e8f8e41c3d776f67233ee5d0e26 /test
parent6b80faa694d9a42c588921fa5a0664671172c2dc (diff)
feat: display `publishConfig` during `config list`
Closes: npm/statusboard#417 If the file at `$NPM_CONFIG_PREFIX/package.json` contains a `publishConfig`, the key/value pairs will be printed along with the rest of the output from `npm config ls`. PR-URL: https://github.com/npm/cli/pull/4146 Credit: @lukekarrys Close: #4146 Reviewed-by: @nlf
Diffstat (limited to 'test')
-rw-r--r--test/lib/commands/config.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/lib/commands/config.js b/test/lib/commands/config.js
index d78e0290a..821713147 100644
--- a/test/lib/commands/config.js
+++ b/test/lib/commands/config.js
@@ -107,6 +107,26 @@ t.test('config list --json', async t => {
t.matchSnapshot(sandbox.output, 'output matches snapshot')
})
+t.test('config list with publishConfig', async t => {
+ const temp = t.testdir({
+ project: {
+ 'package.json': JSON.stringify({
+ publishConfig: {
+ registry: 'https://some.registry',
+ _authToken: 'mytoken',
+ },
+ }),
+ },
+ })
+ const project = join(temp, 'project')
+
+ const sandbox = new Sandbox(t, { project })
+ await sandbox.run('config', ['list', ''])
+ await sandbox.run('config', ['list', '--global'])
+
+ t.matchSnapshot(sandbox.output, 'output matches snapshot')
+})
+
t.test('config delete no args', async t => {
const sandbox = new Sandbox(t)