diff options
author | Netanel Gilad <netanelg@wix.com> | 2020-01-28 10:41:36 +0300 |
---|---|---|
committer | Darcy Clarke <darcy@darcyclarke.me> | 2020-02-25 18:47:53 +0300 |
commit | 7d0cd65b23c0986b631b9b54d87bbe74902cc023 (patch) | |
tree | b0520c852c5d953e220642c205bea1a873f070bb /test | |
parent | 284c1c055a28c4b334496101799acefe3c54ceb3 (diff) |
access: grant is ok with non-scoped
PR-URL: https://github.com/npm/cli/pull/733
Credit: @
Close: #733
Reviewed-by: @Darcy Clarke
Diffstat (limited to 'test')
-rw-r--r-- | test/tap/access.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/tap/access.js b/test/tap/access.js index 4183c46b5..f537db258 100644 --- a/test/tap/access.js +++ b/test/tap/access.js @@ -217,6 +217,33 @@ test('npm access grant read-write', function (t) { ) }) +test('npm access grant read-write on unscoped package', function (t) { + server.filteringRequestBody((body) => { + const data = JSON.parse(body) + t.deepEqual(data, { + permissions: 'read-write', + package: 'another' + }, 'got the right body') + return true + }) + server.put('/-/team/myorg/myteam/package', true).reply(201) + common.npm( + [ + 'access', + 'grant', 'read-write', + 'myorg:myteam', + 'another', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access grant') + t.equal(code, 0, 'exited with Error') + t.end() + } + ) +}) + test('npm access grant others', function (t) { common.npm( [ |