From e8d2adcf40ad63030f844c9aa44c6d16e2146797 Mon Sep 17 00:00:00 2001 From: nlf Date: Wed, 24 Mar 2021 10:47:47 -0700 Subject: [PATCH] fix: config should not error when workspaces are configured PR-URL: https://github.com/npm/cli/pull/2945 Credit: @nlf Close: #2945 Reviewed-by: @wraithgar --- lib/config.js | 4 ++++ test/lib/config.js | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/lib/config.js b/lib/config.js index d5ef6ec50a5e6..6bfde9845ce33 100644 --- a/lib/config.js +++ b/lib/config.js @@ -88,6 +88,10 @@ class Config extends BaseCommand { this.config(args).then(() => cb()).catch(cb) } + execWorkspaces (args, filters, cb) { + this.exec(args, cb) + } + async config ([action, ...args]) { this.npm.log.disableProgress() try { diff --git a/test/lib/config.js b/test/lib/config.js index 14cd816171da5..98ece0f4f05c7 100644 --- a/test/lib/config.js +++ b/test/lib/config.js @@ -93,6 +93,13 @@ t.test('config no args', t => { }) }) +t.test('config ignores workspaces', t => { + config.execWorkspaces([], [], (err) => { + t.match(err, /usage instructions/, 'should not error out when workspaces are defined') + t.end() + }) +}) + t.test('config list', t => { t.plan(2)