diff --git a/lib/access.js b/lib/access.js index 4bb93fda1d0ee..6657f4b0717a1 100644 --- a/lib/access.js +++ b/lib/access.js @@ -154,7 +154,7 @@ access['ls-packages'] = access.lsPackages = ([owner], opts) => { } access['ls-collaborators'] = access.lsCollaborators = ([pkg, usr], opts) => { - return getPackage(pkg).then(pkgName => + return getPackage(pkg, false).then(pkgName => libaccess.lsCollaborators(pkgName, usr, opts) ).then(collabs => { // TODO - print these out nicely (breaking change) diff --git a/test/tap/access.js b/test/tap/access.js index 6a21ccc8fb3ef..d400b4d33b134 100644 --- a/test/tap/access.js +++ b/test/tap/access.js @@ -469,6 +469,34 @@ test('npm access ls-collaborators on package', function (t) { ) }) +test('npm access ls-collaborators on unscoped', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + server.get( + '/-/package/pkg/collaborators?format=cli' + ).reply(200, serverCollaborators) + common.npm( + [ + 'access', + 'ls-collaborators', + 'pkg', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-collaborators') + t.same(JSON.parse(stdout), clientCollaborators) + t.end() + } + ) +}) + test('npm access ls-collaborators on current w/user filter', function (t) { var serverCollaborators = { 'myorg:myteam': 'write',