From 80adc19f9cc4285b7d70c96853fbe1678420df44 Mon Sep 17 00:00:00 2001 From: jhen Date: Fri, 20 Oct 2023 11:19:19 +0800 Subject: [PATCH] fix(jest): add missing loadSession and saveSession mock --- jest/mock.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jest/mock.js b/jest/mock.js index b9db93b8..7f2944a0 100644 --- a/jest/mock.js +++ b/jest/mock.js @@ -144,6 +144,12 @@ if (!NativeModules.RNLlama) { detokenize: jest.fn(async () => ''), embedding: jest.fn(async () => []), + loadSession: jest.fn(async () => ({ + tokens_loaded: 1, + prompt: 'Hello', + })), + saveSession: jest.fn(async () => 1), + releaseContext: jest.fn(() => Promise.resolve()), releaseAllContexts: jest.fn(() => Promise.resolve()),