mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 10:51:23 +00:00
test(gateway): use lightweight clears for openai http agent fences
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user