diff --git a/docs/content/cli-commands/npm-team.md b/docs/content/cli-commands/npm-team.md index 0f463f2985419..9a63b10c26f32 100755 --- a/docs/content/cli-commands/npm-team.md +++ b/docs/content/cli-commands/npm-team.md @@ -28,12 +28,10 @@ Used to manage teams in organizations, and change team memberships. Does not handle permissions for packages. Teams must always be fully qualified with the organization/scope they belong to -when operating on them, separated by a colon (`:`). That is, if you have a -`developers` team on a `foo` organization, you must always refer to that team as `foo:developers` in these commands. +when operating on them, separated by a colon (`:`). That is, if you have a `wombats` team in a `wisdom` organization, you must always refer to that team as `wisdom:wombats` in these commands. * create / destroy: - Create a new team, or destroy an existing one. - + Create a new team, or destroy an existing one. Note: You cannot remove the `developers` team, learn more. * add / rm: Add a user to an existing team, or remove a user from a team they belong to. diff --git a/test/tap/team.js b/test/tap/team.js index 939da45b77883..17acf82f4b231 100644 --- a/test/tap/team.js +++ b/test/tap/team.js @@ -88,6 +88,29 @@ test('team destroy', function (t) { }) }) +test('team destroy is not allowed for the default developers team', (t) => { + const teamData = { + name: 'developers', + scope_id: 1234, + created: '2015-07-23T18:07:49.959Z', + updated: '2015-07-23T18:07:49.959Z', + deleted: '2015-07-23T18:27:27.178Z' + } + server.delete('/-/team/myorg/' + teamData.name).reply(405, teamData) + common.npm([ + 'team', 'destroy', 'myorg:' + teamData.name, + '--registry', common.registry, + '--loglevel', 'silent', + '--json' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 1, 'exited with code 1') + t.equal(stderr, '', 'no error output') + t.match(JSON.parse(stdout), {error: {code: 'E405'}}) + t.end() + }) +}) + test('team add', function (t) { var user = 'zkat' server.put('/-/team/myorg/myteam/user', JSON.stringify({