Generate Fern TypeSscript SDK (#3785)

This commit is contained in:
Stanislav Novosad
2025-10-23 20:14:59 -06:00
committed by GitHub
parent d55b9637c4
commit 2062adac66
239 changed files with 14550 additions and 3 deletions

View File

@@ -0,0 +1,44 @@
// This file was auto-generated by Fern from our API Definition.
import * as Skyvern from "../../src/api/index";
import { SkyvernClient } from "../../src/Client";
import { mockServerPool } from "../mock-server/MockServerPool";
describe("Scripts", () => {
test("runScript (1)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ xApiKey: "test", apiKey: "test", environment: server.baseUrl });
const rawResponseBody = { key: "value" };
server
.mockEndpoint()
.post("/v1/scripts/s_abc123/run")
.respondWith()
.statusCode(200)
.jsonBody(rawResponseBody)
.build();
const response = await client.scripts.runScript("s_abc123");
expect(response).toEqual({
key: "value",
});
});
test("runScript (2)", async () => {
const server = mockServerPool.createServer();
const client = new SkyvernClient({ xApiKey: "test", apiKey: "test", environment: server.baseUrl });
const rawResponseBody = { key: "value" };
server
.mockEndpoint()
.post("/v1/scripts/script_id/run")
.respondWith()
.statusCode(422)
.jsonBody(rawResponseBody)
.build();
await expect(async () => {
return await client.scripts.runScript("script_id");
}).rejects.toThrow(Skyvern.UnprocessableEntityError);
});
});