From 1dd17286156dc765223d95f45fa25d050283201c Mon Sep 17 00:00:00 2001 From: dovgopoly Date: Thu, 9 May 2024 04:57:36 +0300 Subject: [PATCH] automated input --- test/CircomZKit.test.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/CircomZKit.test.ts b/test/CircomZKit.test.ts index b8016d2..3b8a9db 100644 --- a/test/CircomZKit.test.ts +++ b/test/CircomZKit.test.ts @@ -1,5 +1,15 @@ -import { CircomZKit } from "../src"; -import { ManagerZKit } from "../src/ManagerZKit"; +import { CircomZKit, ManagerZKit } from "../src"; + +jest.mock("readline", () => ({ + createInterface: jest.fn().mockReturnValue({ + question: jest + .fn() + .mockImplementation((_query: string, cb: (answer: string) => void) => { + cb("Y"); + }), + close: jest.fn().mockImplementation(() => undefined), + }), +})); describe("happy flow", function () { test("happy flow", async () => { @@ -23,5 +33,5 @@ describe("happy flow", function () { console.log(await circuit.verifyProof(proof)); console.log(await circuit.generateCalldata(proof)); - }, 20000); + }); });