fix(commands): use dynamic base branch and safe rollback in remove-ai-slops
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
/// <reference path="../../../bun-test.d.ts" />
|
||||
|
||||
import { afterEach, beforeEach, describe, test, expect } from "bun:test"
|
||||
import { loadBuiltinCommands } from "./commands"
|
||||
import { HANDOFF_TEMPLATE } from "./templates/handoff"
|
||||
@@ -170,6 +172,15 @@ describe("REMOVE_AI_SLOPS_TEMPLATE", () => {
|
||||
expect(REMOVE_AI_SLOPS_TEMPLATE).toContain("Safety Verification")
|
||||
expect(REMOVE_AI_SLOPS_TEMPLATE).toContain("Behavior Preservation")
|
||||
})
|
||||
|
||||
test("should detect the base branch dynamically instead of hardcoding main", () => {
|
||||
//#given - the template string
|
||||
|
||||
//#when / #then
|
||||
expect(REMOVE_AI_SLOPS_TEMPLATE).toContain("git symbolic-ref refs/remotes/origin/HEAD")
|
||||
expect(REMOVE_AI_SLOPS_TEMPLATE).toContain('git merge-base "$BASE_BRANCH" HEAD')
|
||||
expect(REMOVE_AI_SLOPS_TEMPLATE).not.toContain("git merge-base main HEAD")
|
||||
})
|
||||
})
|
||||
|
||||
describe("HANDOFF_TEMPLATE", () => {
|
||||
|
||||
Reference in New Issue
Block a user