From 65adf442b815389898dc65bbc7f8d404bcbb922c Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Fri, 2 Aug 2024 16:20:12 -0700 Subject: [PATCH] Remove redundant test --- .../src/runnables/tests/runnable_map.test.ts | 53 ------------------- 1 file changed, 53 deletions(-) diff --git a/langchain-core/src/runnables/tests/runnable_map.test.ts b/langchain-core/src/runnables/tests/runnable_map.test.ts index 77f662751d08..ffb41ab4e527 100644 --- a/langchain-core/src/runnables/tests/runnable_map.test.ts +++ b/langchain-core/src/runnables/tests/runnable_map.test.ts @@ -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((resolve) => { - controller.abort(); - resolve(); - }), - ]); - }).rejects.toThrowError(); - await expect(async () => { - const controller = new AbortController(); - await Promise.all([ - map.invoke("testing", { - signal: controller.signal, - }), - new Promise((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}"