test(gateway): use lightweight clears for openai http agent fences

This commit is contained in:
Peter Steinberger
2026-02-22 07:49:57 +00:00
parent d624aa5ab2
commit 682e42b0a1

View File

@@ -95,7 +95,7 @@ describe("OpenAI-compatible HTTP API (e2e)", () => {
it("handles request validation and routing", async () => {
const port = enabledPort;
const mockAgentOnce = (payloads: Array<{ text: string }>) => {
agentCommand.mockReset();
agentCommand.mockClear();
agentCommand.mockResolvedValueOnce({ payloads } as never);
};
const expectAgentSessionKeyMatch = async (request: {
@@ -397,7 +397,7 @@ describe("OpenAI-compatible HTTP API (e2e)", () => {
const port = enabledPort;
try {
{
agentCommand.mockReset();
agentCommand.mockClear();
agentCommand.mockImplementationOnce((async (opts: unknown) =>
buildAssistantDeltaResult({
opts,
@@ -431,7 +431,7 @@ describe("OpenAI-compatible HTTP API (e2e)", () => {
}
{
agentCommand.mockReset();
agentCommand.mockClear();
agentCommand.mockImplementationOnce((async (opts: unknown) =>
buildAssistantDeltaResult({
opts,
@@ -460,7 +460,7 @@ describe("OpenAI-compatible HTTP API (e2e)", () => {
}
{
agentCommand.mockReset();
agentCommand.mockClear();
agentCommand.mockResolvedValueOnce({
payloads: [{ text: "hello" }],
} as never);