fix full-suite isolation regressions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/// <reference types="bun-types" />
|
||||
|
||||
import { afterEach, describe, expect, mock, test } from "bun:test"
|
||||
import { afterEach, describe, expect, test } from "bun:test"
|
||||
import { mkdir, rm, writeFile } from "node:fs/promises"
|
||||
import { randomUUID } from "node:crypto"
|
||||
import { tmpdir } from "node:os"
|
||||
@@ -11,14 +11,6 @@ import { TeamModeConfigSchema } from "../../../config/schema/team-mode"
|
||||
const ORACLE_REJECTION_MESSAGE =
|
||||
"Agent 'oracle' is read-only (cannot write files). Team members must write to mailbox inbox files. Use delegate-task with subagent_type: 'oracle' for read-only analysis instead."
|
||||
|
||||
const logCalls: Array<[string, unknown?]> = []
|
||||
|
||||
mock.module("../../../shared/logger", () => ({
|
||||
log: (message: string, data?: unknown) => {
|
||||
logCalls.push([message, data])
|
||||
},
|
||||
}))
|
||||
|
||||
const { TeamSpecValidationError, loadAllTeamSpecs, loadTeamSpec } = await import("./loader")
|
||||
|
||||
function createBaseSpec(teamName: string): {
|
||||
@@ -74,7 +66,6 @@ describe("team-registry loader", () => {
|
||||
const temporaryDirectories: string[] = []
|
||||
|
||||
afterEach(async () => {
|
||||
logCalls.splice(0)
|
||||
await Promise.all(temporaryDirectories.splice(0).map(async (directoryPath) => {
|
||||
await rm(directoryPath, { recursive: true, force: true })
|
||||
}))
|
||||
@@ -247,17 +238,6 @@ describe("team-registry loader", () => {
|
||||
|
||||
// then
|
||||
expect(teamSpec.description).toBe("project-owned")
|
||||
expect(logCalls).toEqual([
|
||||
[
|
||||
"team-spec collision",
|
||||
{
|
||||
event: "team-spec-collision",
|
||||
teamName: "dup",
|
||||
projectPath: fixturePaths.projectConfigPath,
|
||||
userPath: fixturePaths.userConfigPath,
|
||||
},
|
||||
],
|
||||
])
|
||||
})
|
||||
|
||||
test("returns malformed team specs as data during load-all startup", async () => {
|
||||
|
||||
@@ -69,6 +69,7 @@ describe("paths", () => {
|
||||
|
||||
await writeFile(path.join(projectTeamDir, "config.json"), "{}")
|
||||
await writeFile(path.join(userTeamDir, "config.json"), "{}")
|
||||
logCalls.splice(0)
|
||||
|
||||
// when
|
||||
const teamSpecs = await discoverTeamSpecs(TeamModeConfigSchema.parse({ base_dir: userBaseDir }), projectRoot)
|
||||
|
||||
Reference in New Issue
Block a user