test: dedupe and optimize test suites

This commit is contained in:
Peter Steinberger
2026-02-19 15:18:50 +00:00
parent b0e55283d5
commit a1cb700a05
80 changed files with 2627 additions and 2962 deletions

View File

@@ -2,6 +2,7 @@ import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { compactEmbeddedPiSession } from "../../agents/pi-embedded.js";
import {
addSubagentRunForTests,
listSubagentRunsForRequester,
@@ -294,7 +295,6 @@ describe("/compact command", () => {
});
it("returns null when command is not /compact", async () => {
const { compactEmbeddedPiSession } = await import("../../agents/pi-embedded.js");
const cfg = {
commands: { text: true },
channels: { whatsapp: { allowFrom: ["*"] } },
@@ -313,7 +313,6 @@ describe("/compact command", () => {
});
it("rejects unauthorized /compact commands", async () => {
const { compactEmbeddedPiSession } = await import("../../agents/pi-embedded.js");
const cfg = {
commands: { text: true },
channels: { whatsapp: { allowFrom: ["*"] } },
@@ -337,7 +336,6 @@ describe("/compact command", () => {
});
it("routes manual compaction with explicit trigger and context metadata", async () => {
const { compactEmbeddedPiSession } = await import("../../agents/pi-embedded.js");
const cfg = {
commands: { text: true },
channels: { whatsapp: { allowFrom: ["*"] } },