Skip to content

Commit

Permalink
Hot fix for now teams ls (#1737)
Browse files Browse the repository at this point in the history
* Hot fix for `now teams ls`

* Added integration test
  • Loading branch information
leo committed Dec 10, 2018
1 parent 9b922c9 commit 1f2a0d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
9 changes: 0 additions & 9 deletions src/commands/teams/list.js
Expand Up @@ -48,15 +48,6 @@ export default async function({ teams, config, apiUrl, token }) {
);
const choice = teamList.splice(index, 1)[0];
teamList.unshift(choice);
} else {
currentTeam = list.find(team => team.id === currentTeam);

if (!currentTeam) {
console.error(
error(`You are not a part of the current team anymore`)
);
return 1;
}
}

// Printing
Expand Down
21 changes: 13 additions & 8 deletions test/integration.js
@@ -1,20 +1,12 @@
// Native
import path from 'path';

import { URL } from 'url';

// Packages
import test from 'ava';

import semVer from 'semver';
import fs from 'fs';
import execa from 'execa';
import fetch from 'node-fetch';
import tmp from 'tmp-promise';

// Utilities
import logo from '../src/util/output/logo';

import sleep from '../src/util/sleep';
import pkg from '../package';
import parseList from './helpers/parse-list';
Expand Down Expand Up @@ -122,6 +114,19 @@ test('log in', async t => {
t.is(last, goal);
});

test('list the scopes', async t => {
const { stdout, code } = await execa(binaryPath, [
'teams',
'ls',
...defaultArgs
], {
reject: false
});

t.is(code, 0);
t.true(stdout.includes(`✔ ${email} ${email}`));
});

test('list the payment methods', async t => {
const { stdout, code } = await execa(binaryPath, [
'billing',
Expand Down

0 comments on commit 1f2a0d6

Please sign in to comment.