laconic-registry-cli/test/cli.test.ts

29 lines
749 B
TypeScript

import { spawnSync } from 'child_process';
describe('Test laconic CLI commands', () => {
beforeAll(async () => {
// TODO: Install laconic binary (create symlink in path)
// TODO: Create a temp directory to run the tests in and cd into that
});
afterAll(async () => {
// TODO: Cleanup temp dir
});
test('laconic', async () => {
const result = spawnSync('laconic');
const output = result.stdout.toString().trim();
const errorOutput = result.stderr.toString().trim();
// Expect error with usage string
expect(output).toBe('');
expect(errorOutput).toContain('laconic <command>');
expect(result.status).toBe(1);
});
describe('laconic <command>', () => {
// TODO: Test subcommands
});
});