Files
orca/config/scripts/git-pull-request-diff-base.test.mjs
T
Neil 8be3cb963e Revert "ci: full checks on main pushes, changed-file lint on PRs, Slack alert when main breaks (#37282)" (#37341)
Main went red right away on the full main-push runs. Reverting to the previous PR-only checks.

This reverts commit a7ae68fc6f.
2026-11-01 22:45:18 -08:00

20 lines
727 B
JavaScript

import { describe, expect, it } from 'vitest'
import { selectPullRequestDiffBase } from './git-pull-request-diff-base.mjs'
describe('pull request diff base selection', () => {
it('uses the merge commit first parent for pull request checkouts', () => {
expect(
selectPullRequestDiffBase('event-base', ['current-base', 'pull-request-head'], 'pull_request')
).toBe('current-base')
})
it('keeps the requested base outside synthetic pull request merges', () => {
expect(selectPullRequestDiffBase('requested-base', ['parent'], 'pull_request')).toBe(
'requested-base'
)
expect(selectPullRequestDiffBase('requested-base', ['parent', 'other'], 'push')).toBe(
'requested-base'
)
})
})