mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 09:42:44 +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 () => {
|
it("handles request validation and routing", async () => {
|
||||||
const port = enabledPort;
|
const port = enabledPort;
|
||||||
const mockAgentOnce = (payloads: Array<{ text: string }>) => {
|
const mockAgentOnce = (payloads: Array<{ text: string }>) => {
|
||||||
agentCommand.mockReset();
|
agentCommand.mockClear();
|
||||||
agentCommand.mockResolvedValueOnce({ payloads } as never);
|
agentCommand.mockResolvedValueOnce({ payloads } as never);
|
||||||
};
|
};
|
||||||
const expectAgentSessionKeyMatch = async (request: {
|
const expectAgentSessionKeyMatch = async (request: {
|
||||||
@@ -397,7 +397,7 @@ describe("OpenAI-compatible HTTP API (e2e)", () => {
|
|||||||
const port = enabledPort;
|
const port = enabledPort;
|
||||||
try {
|
try {
|
||||||
{
|
{
|
||||||
agentCommand.mockReset();
|
agentCommand.mockClear();
|
||||||
agentCommand.mockImplementationOnce((async (opts: unknown) =>
|
agentCommand.mockImplementationOnce((async (opts: unknown) =>
|
||||||
buildAssistantDeltaResult({
|
buildAssistantDeltaResult({
|
||||||
opts,
|
opts,
|
||||||
@@ -431,7 +431,7 @@ describe("OpenAI-compatible HTTP API (e2e)", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
agentCommand.mockReset();
|
agentCommand.mockClear();
|
||||||
agentCommand.mockImplementationOnce((async (opts: unknown) =>
|
agentCommand.mockImplementationOnce((async (opts: unknown) =>
|
||||||
buildAssistantDeltaResult({
|
buildAssistantDeltaResult({
|
||||||
opts,
|
opts,
|
||||||
@@ -460,7 +460,7 @@ describe("OpenAI-compatible HTTP API (e2e)", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
agentCommand.mockReset();
|
agentCommand.mockClear();
|
||||||
agentCommand.mockResolvedValueOnce({
|
agentCommand.mockResolvedValueOnce({
|
||||||
payloads: [{ text: "hello" }],
|
payloads: [{ text: "hello" }],
|
||||||
} as never);
|
} as never);
|
||||||
|
|||||||
Reference in New Issue
Block a user