9b395f5cc3
Build Chrome Extension / build (push) Waiting to run
Trigger Website Rebuild (Docs Updated) / dispatch (push) Waiting to run
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
19 lines
794 B
TypeScript
19 lines
794 B
TypeScript
import { expect } from 'vitest';
|
|
import { runCli } from './helpers.js';
|
|
|
|
/**
|
|
* Verify a login-required command fails gracefully (no crash, no hang).
|
|
* Acceptable outcomes: exit code 1 with error message, OR timeout handled.
|
|
*/
|
|
export async function expectGracefulAuthFailure(args: string[]) {
|
|
const { stdout, stderr, code } = await runCli(args, { timeout: 60_000 });
|
|
// Should either fail with exit code 1 (error message) or succeed with empty data.
|
|
// The key assertion: it should NOT hang forever or crash with unhandled exception.
|
|
if (code !== 0) {
|
|
// Verify stderr has a meaningful error, not an unhandled crash.
|
|
const output = stderr + stdout;
|
|
expect(output.length).toBeGreaterThan(0);
|
|
}
|
|
// If it somehow succeeds (e.g., partial public data), that's fine too.
|
|
}
|