Skip to content

Commit

Permalink
Remove redundant test
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Aug 2, 2024
1 parent a44c38a commit 65adf44
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions langchain-core/src/runnables/tests/runnable_map.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,59 +67,6 @@ test("Test map inference in a sequence", async () => {
);
});

test("Test invoke with signal", async () => {
const map = RunnableMap.from({
question: new RunnablePassthrough(),
context: async () => {
await new Promise((resolve) => setTimeout(resolve, 500));
return "SOME STUFF";
},
});
await expect(async () => {
const controller = new AbortController();
await Promise.all([
map.invoke("testing", {
signal: controller.signal,
}),
new Promise<void>((resolve) => {
controller.abort();
resolve();
}),
]);
}).rejects.toThrowError();
await expect(async () => {
const controller = new AbortController();
await Promise.all([
map.invoke("testing", {
signal: controller.signal,
}),
new Promise<void>((resolve) => {
setTimeout(() => {
controller.abort();
resolve();
}, 250);
}),
]);
}).rejects.toThrowError();
});

test("Test stream with signal", async () => {
const map = RunnableMap.from({
question: new RunnablePassthrough(),
context: async () => {
await new Promise((resolve) => setTimeout(resolve, 500));
return "SOME STUFF";
},
});
const controller = new AbortController();
await expect(async () => {
const stream = await map.stream("TESTING", { signal: controller.signal });
for await (const _ of stream) {
controller.abort();
}
}).rejects.toThrowError();
});

test("Should not allow mismatched inputs", async () => {
const prompt = ChatPromptTemplate.fromTemplate(
"context: {context}, question: {question}"
Expand Down

0 comments on commit 65adf44

Please sign in to comment.