Files
orca/src/main/git/fetch-error-classification.test.ts
T
AnweshandNeil 95577ea9a0 Fix start-from PR failures for fork-backed PRs (#2233)
* Fix start-from PR failures for some fork PRs

* fix: limit PR fallback fetches to missing refs

---------

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
2026-05-18 00:36:34 -07:00

25 lines
811 B
TypeScript

import { describe, expect, it } from 'vitest'
import { isMissingRemoteRefGitError } from './fetch-error-classification'
describe('isMissingRemoteRefGitError', () => {
it('matches missing remote ref messages', () => {
expect(
isMissingRemoteRefGitError(
new Error('fatal: could not find remote ref refs/heads/feature/test')
)
).toBe(true)
expect(
isMissingRemoteRefGitError(
new Error("fatal: couldn't find remote ref refs/heads/feature/test")
)
).toBe(true)
})
it('does not match auth or network failures', () => {
expect(isMissingRemoteRefGitError(new Error('fatal: Authentication failed'))).toBe(false)
expect(
isMissingRemoteRefGitError(new Error('fatal: unable to access repo: Could not resolve host'))
).toBe(false)
})
})