diff --git a/lib/utils/flat-options.js b/lib/utils/flat-options.js index bfe6316c1f10f..2ace852d1e36a 100644 --- a/lib/utils/flat-options.js +++ b/lib/utils/flat-options.js @@ -68,9 +68,7 @@ const flatOptions = npm => npm.flatOptions || Object.freeze({ npm.config.get('registry'), sendMetrics: npm.config.get('send-metrics'), registry: npm.config.get('registry'), - get scope () { - return npm.projectScope - }, + scope: npm.config.get('scope'), access: npm.config.get('access'), alwaysAuth: npm.config.get('always-auth'), audit: npm.config.get('audit'), diff --git a/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js b/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js index a5275eedbac5c..89a5527299f7d 100644 --- a/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js +++ b/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js @@ -96,7 +96,7 @@ Object { "saveBundle": false, "savePrefix": "", "saveType": "peerOptional", - "scope": "@npmcli", + "scope": "", "scriptShell": "script-shell", "search": Object { "description": "description", diff --git a/test/lib/utils/flat-options.js b/test/lib/utils/flat-options.js index 1d97845f3c667..daade6663977b 100644 --- a/test/lib/utils/flat-options.js +++ b/test/lib/utils/flat-options.js @@ -104,6 +104,7 @@ class MockConfig { 'cache-max': 'cache-max', 'cache-min': 'cache-min', 'strict-ssl': 'strict-ssl', + scope: '', tag: 'tag', 'user-agent': 'user-agent', '@scope:registry': '@scope:registry', @@ -187,15 +188,6 @@ t.test('tag emits warning', t => { t.end() }) -t.test('scope emits warning', t => { - const npm = new Mocknpm() - logs.length = 0 - t.equal(flatOptions(npm).scope, '@npmcli') - t.match(logs, []) - logs.length = 0 - t.end() -}) - t.test('omit/include options', t => { t.test('omit explicitly', t => { const npm = new Mocknpm({ @@ -291,6 +283,7 @@ t.test('various default values and falsey fallbacks', t => { 'metricsRegistry defaults to registry') t.equal(opts.search.limit, 20, 'searchLimit defaults to 20') t.equal(opts.savePrefix, '>=', 'save-prefix respected if no save-exact') + t.equal(opts.scope, '', 'scope defaults to empty string') logs.length = 0 t.end() })