This commit is contained in:
Nathan Flurry 2026-03-14 20:28:41 -07:00
parent 3263d4f5e1
commit 0fbea6ce61
166 changed files with 6675 additions and 7105 deletions

View file

@ -9,7 +9,7 @@ export function createTestConfig(overrides?: Partial<AppConfig>): AppConfig {
return ConfigSchema.parse({
auto_submit: true,
notify: ["terminal" as const],
workspace: { default: "default" },
organization: { default: "default" },
backend: {
host: "127.0.0.1",
port: 7741,
@ -19,7 +19,7 @@ export function createTestConfig(overrides?: Partial<AppConfig>): AppConfig {
backup_interval_secs: 3600,
backup_retention_days: 7,
},
providers: {
sandboxProviders: {
local: {},
e2b: {},
},

View file

@ -1,48 +1,15 @@
import type { BackendDriver, GitDriver, GithubDriver, StackDriver, TmuxDriver } from "../../src/driver.js";
import type { BackendDriver, GithubDriver, TmuxDriver } from "../../src/driver.js";
export function createTestDriver(overrides?: Partial<BackendDriver>): BackendDriver {
return {
git: overrides?.git ?? createTestGitDriver(),
stack: overrides?.stack ?? createTestStackDriver(),
github: overrides?.github ?? createTestGithubDriver(),
tmux: overrides?.tmux ?? createTestTmuxDriver(),
};
}
export function createTestGitDriver(overrides?: Partial<GitDriver>): GitDriver {
return {
validateRemote: async () => {},
ensureCloned: async () => {},
fetch: async () => {},
listRemoteBranches: async () => [],
listLocalRemoteRefs: async () => [],
remoteDefaultBaseRef: async () => "origin/main",
revParse: async () => "abc1234567890",
ensureRemoteBranch: async () => {},
diffStatForBranch: async () => "+0/-0",
conflictsWithMain: async () => false,
...overrides,
};
}
export function createTestStackDriver(overrides?: Partial<StackDriver>): StackDriver {
return {
available: async () => false,
listStack: async () => [],
syncRepo: async () => {},
restackRepo: async () => {},
restackSubtree: async () => {},
rebaseBranch: async () => {},
reparentBranch: async () => {},
trackBranch: async () => {},
...overrides,
};
}
export function createTestGithubDriver(overrides?: Partial<GithubDriver>): GithubDriver {
return {
listPullRequests: async () => [],
createPr: async (_repoPath, _headBranch, _title) => ({
createPr: async (_repoFullName, _headBranch, _title) => ({
number: 1,
url: `https://github.com/test/repo/pull/1`,
}),