mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
* fix(git): reduce queries and preserve data across execution hosts * fix(ci): exercise pinned Git and serialize mobile dependency entrypoints * fix(relay): preserve fresh diff retries after hung shared reads * test(git): wait for fetch barrier before canceling preparation * fix(i18n): describe index-preserving discard in every locale * fix(git): retain clone diagnostics and allow WSL policy startup * test(git): refresh default-base and branch-safety fixtures
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { GitCommandTimeoutError, gitCommandTimeoutMs } from './git-command-timeout'
|
|
|
|
describe('gitCommandTimeoutMs', () => {
|
|
it.each([
|
|
[['status', '--porcelain=v2'], 120_000],
|
|
[['show', 'HEAD:file'], 120_000],
|
|
[['diff-tree', '--root', '-r', 'HEAD'], 120_000],
|
|
[['fetch', 'origin'], undefined],
|
|
[['checkout', 'main'], undefined],
|
|
[['unknown'], undefined]
|
|
] as const)('selects the fail-safe default for %j', (args, expected) => {
|
|
expect(gitCommandTimeoutMs(args, undefined)).toBe(expected)
|
|
})
|
|
|
|
it('preserves every explicit timeout', () => {
|
|
expect(gitCommandTimeoutMs(['status'], 7)).toBe(7)
|
|
expect(gitCommandTimeoutMs(['fetch'], 7)).toBe(7)
|
|
})
|
|
|
|
it('provides a deterministic read-timeout seam', () => {
|
|
expect(gitCommandTimeoutMs(['status'], undefined, 25)).toBe(25)
|
|
})
|
|
})
|
|
|
|
describe('GitCommandTimeoutError', () => {
|
|
it('is typed and retains its deadline', () => {
|
|
const error = new GitCommandTimeoutError(25)
|
|
expect(error).toBeInstanceOf(Error)
|
|
expect(error).toMatchObject({ name: 'GitCommandTimeoutError', timeoutMs: 25 })
|
|
})
|
|
})
|