mirror of
https://github.com/samsonjs/Peekaboo.git
synced 2026-04-18 13:25:49 +00:00
Fix invalid command test to properly capture error output
This commit is contained in:
parent
7fadd6e5f1
commit
61d6ef0cee
1 changed files with 15 additions and 3 deletions
|
|
@ -533,9 +533,21 @@ function checkSwiftCLIIntegration() {
|
|||
log('Testing Swift CLI error handling and edge cases...', colors.cyan);
|
||||
|
||||
// Test 1: Invalid command (since image is default, this gets interpreted as image subcommand argument)
|
||||
const invalidCmd = exec('./peekaboo invalid-command 2>&1', { allowFailure: true });
|
||||
if (!invalidCmd || !invalidCmd.includes('Unexpected argument')) {
|
||||
logError('Swift CLI should show error for invalid command');
|
||||
let invalidOutput;
|
||||
try {
|
||||
execSync('./peekaboo invalid-command 2>&1', {
|
||||
cwd: projectRoot,
|
||||
encoding: 'utf8',
|
||||
stdio: 'pipe'
|
||||
});
|
||||
logError('Swift CLI should fail for invalid command');
|
||||
return false;
|
||||
} catch (error) {
|
||||
invalidOutput = error.stdout || error.stderr || error.toString();
|
||||
}
|
||||
|
||||
if (!invalidOutput.includes('Unexpected argument')) {
|
||||
logError('Swift CLI should show proper error for invalid command');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue