Skip to content

Commit

Permalink
deflake
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw committed Aug 8, 2024
1 parent 88fbcb5 commit 738b1f2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions js/src/tests/client.int.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,11 @@ test.concurrent("Test run stats", async () => {

test("Test list prompts", async () => {
const client = new Client();
const uid = uuidv4();
// push 3 prompts
const promptName1 = `test_prompt_${uuidv4().slice(0, 8)}`;
const promptName2 = `test_prompt_${uuidv4().slice(0, 8)}`;
const promptName3 = `test_prompt_${uuidv4().slice(0, 8)}`;
const promptName1 = `test_prompt_${uid}__0`;
const promptName2 = `test_prompt_${uid}__1`;
const promptName3 = `test_prompt_${uid}__2`;

await client.pushPrompt(promptName1, {
object: ChatPromptTemplate.fromMessages(
Expand Down Expand Up @@ -794,7 +795,7 @@ test("Test list prompts", async () => {
});

// expect at least one of the prompts to have promptName1
const response = await client.listPrompts({ isPublic: true });
const response = client.listPrompts({ isPublic: true, query: uid });
let found = false;
expect(response).toBeDefined();
for await (const prompt of response) {
Expand All @@ -806,7 +807,7 @@ test("Test list prompts", async () => {
expect(found).toBe(true);

// expect the prompts to be sorted by updated_at
const response2 = client.listPrompts({ sortField: "updated_at" });
const response2 = client.listPrompts({ sortField: "updated_at", query: uid });
expect(response2).toBeDefined();
let lastUpdatedAt: number | undefined;
for await (const prompt of response2) {
Expand Down

0 comments on commit 738b1f2

Please sign in to comment.