Skip to content

Commit

Permalink
fix: Increase timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeesha committed Nov 1, 2024
1 parent dc3a6fe commit a88e4f4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sdk-node/src/Inferable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ describe("Inferable", () => {
});

it("should initialize without optional args", () => {
expect(
() => new Inferable({ apiSecret: TEST_API_SECRET }),
).not.toThrow();
expect(() => new Inferable({ apiSecret: TEST_API_SECRET })).not.toThrow();
});

it("should initialize with API secret in environment", () => {
Expand Down Expand Up @@ -243,7 +241,7 @@ describe("Functions", () => {
// This should match the example in the readme
describe("Inferable SDK End to End Test", () => {
it("should trigger a run, call a function, and call a status change function", async () => {
const client = inferableInstance();
const client = inferableInstance();

let didCallSayHello = false;
let didCallOnStatusChange = false;
Expand Down Expand Up @@ -279,15 +277,15 @@ describe("Inferable SDK End to End Test", () => {
attachedFunctions: [sayHello],
// Optional: Define a schema for the result to conform to
resultSchema: z.object({
didSayHello: z.boolean()
didSayHello: z.boolean(),
}),
// Optional: Subscribe an Inferable function to receive notifications when the run status changes
onStatusChange: { function: onStatusChange },
});

const result = await run.poll();

await new Promise((resolve) => setTimeout(resolve, 500));
await new Promise((resolve) => setTimeout(resolve, 5000));

expect(result).not.toBeNull();
expect(didCallSayHello).toBe(true);
Expand Down

0 comments on commit a88e4f4

Please sign in to comment.