mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-04-20 03:02:51 -04:00
Split smoke, core, and prompt-module suites and make test:e2e self-contained with an explicit build step and version-check bypass. Move core CLI coverage to a process-based harness with mock OpenAI boundary checks, add user-path scenarios, refresh CI jobs, and commit the rebuilt out/cli.cjs artifact.
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import packageJson from '../../package.json';
|
|
import 'cli-testing-library/extend-expect';
|
|
import { runCli, waitForExit } from './utils';
|
|
|
|
it('prints help without entering the interactive flow', async () => {
|
|
const help = await runCli(['--help'], {
|
|
cwd: process.cwd()
|
|
});
|
|
|
|
expect(await help.findByText('opencommit')).toBeInTheConsole();
|
|
expect(await help.findByText('--context')).toBeInTheConsole();
|
|
expect(await help.findByText('--yes')).toBeInTheConsole();
|
|
expect(await help.queryByText('Select your AI provider:')).not.toBeInTheConsole();
|
|
expect(await help.queryByText('Enter your API key:')).not.toBeInTheConsole();
|
|
expect(await waitForExit(help)).toBe(0);
|
|
});
|
|
|
|
it('prints the current version without booting the CLI runtime', async () => {
|
|
const version = await runCli(['--version'], {
|
|
cwd: process.cwd()
|
|
});
|
|
|
|
expect(await version.findByText(packageJson.version)).toBeInTheConsole();
|
|
expect(await version.queryByText('Generating the commit message')).not.toBeInTheConsole();
|
|
expect(await waitForExit(version)).toBe(0);
|
|
});
|