Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: scope config #1758

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/utils/flat-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Object {
"saveBundle": false,
"savePrefix": "",
"saveType": "peerOptional",
"scope": "@npmcli",
"scope": "",
"scriptShell": "script-shell",
"search": Object {
"description": "description",
Expand Down
11 changes: 2 additions & 9 deletions test/lib/utils/flat-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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()
})
Expand Down