Files
vercel/packages/cli/test/unit/commands/alias.test.ts
Andy McKay 4bf3c237ee [cli] Revert some tables back to stdout (#9227)
In https://github.com/vercel/vercel/pull/8735 some output was sent to `stderr`, this sends them `stdout` instead.
2023-01-20 20:58:28 +00:00

25 lines
799 B
TypeScript

import { client } from '../../mocks/client';
import alias from '../../../src/commands/alias';
import { useUser } from '../../mocks/user';
import { useAlias } from '../../mocks/alias';
describe('alias', () => {
it('should list up to 20 aliases by default', async () => {
useUser();
useAlias();
client.setArgv('alias', 'ls');
const exitCodePromise = alias(client);
await expect(exitCodePromise).resolves.toEqual(0);
await expect(client.stdout).toOutput('dummy-19.app');
});
it('should list up to 2 aliases', async () => {
useUser();
useAlias();
client.setArgv('alias', 'ls', '--limit', '2');
const exitCodePromise = alias(client);
await expect(exitCodePromise).resolves.toEqual(0);
await expect(client.stdout).toOutput('dummy-1.app');
});
});