chore: 移除所有 e2e 测试

This commit is contained in:
2026-06-10 09:27:03 +08:00
parent 641d23b7c8
commit e3067d017e
16 changed files with 3 additions and 1389 deletions

View File

@@ -1,46 +0,0 @@
import { existsSync } from "node:fs";
import { mkdir, writeFile, rm } from "node:fs/promises";
import { join } from "node:path";
import { runInit } from "../../src/commands/init.ts";
import { loadConfig, getChangeDir } from "../../src/core/config.ts";
import type { RuneConfig } from "../../src/types.ts";
const TMP_DIR = join(import.meta.dir, "__tmp_agent_test__");
export function getTempDir(): string {
return TMP_DIR;
}
export async function setupTempDir(): Promise<void> {
await rm(TMP_DIR, { recursive: true, force: true });
await mkdir(TMP_DIR, { recursive: true });
}
export async function cleanupTempDir(): Promise<void> {
await rm(TMP_DIR, { recursive: true, force: true });
}
export async function createFreshProject(editors: string[] = ["opencode"]): Promise<RuneConfig> {
await runInit(TMP_DIR, editors);
return loadConfig(TMP_DIR);
}
export async function createChangeDir(changeName: string): Promise<string> {
const dir = getChangeDir(TMP_DIR, changeName);
await mkdir(dir, { recursive: true });
return dir;
}
export async function writeDoc(
changeName: string,
docName: string,
content: string,
): Promise<void> {
const dir = getChangeDir(TMP_DIR, changeName);
await mkdir(dir, { recursive: true });
await writeFile(join(dir, `${docName}.md`), content);
}
export function changeFileExists(changeName: string, fileName: string): boolean {
return existsSync(join(getChangeDir(TMP_DIR, changeName), fileName));
}