Files
vercel/packages/cli/test/unit/commands/certs.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
812 B
TypeScript

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