fix(gateway): bound git scenario preview fan-out

This commit is contained in:
2026-08-04 16:42:14 +00:00
parent d44a3eb4af
commit 67e8ee50a7
2 changed files with 17 additions and 1 deletions
@@ -15,4 +15,14 @@ describe('scenarioCatalog git ref support', () => {
const sorted = [...ids].sort((a, b) => a - b);
expect(ids).toEqual(sorted);
});
it('rejects without crashing when git cannot be spawned', async () => {
const originalPath = process.env.PATH;
process.env.PATH = '/nonexistent';
try {
await expect(resolveGitCommitSha('HEAD')).rejects.toThrow('git ref not found.');
} finally {
process.env.PATH = originalPath;
}
});
});