Hi - I am writing a custom checkpoint saver to save checkpoints to session storage or local storage in the browser. I would like to write tests in Jest as I develop it, but when I run jest, it tells me:
/Users/me/gh/my-project/node_modules/@langchain/langgraph/web.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export * from './dist/web.js'
^^^^^^
SyntaxError: Unexpected token 'export'
1 | import type { RunnableConfig } from "@langchain/core/runnables";
> 2 | import { BaseCheckpointSaver } from "@langchain/langgraph/web";
I am able to write a test outside of jest using Typescript with assert statements, and running it with tsx.
I would prefer to include this test with our suite of Jest tests, and to be able to use Jest.
Any suggestions for being able to test my custom checkpoint saver with Jest?
Also, any advice about creating a checkpoint saver that uses session storage or local storage? I am using the SqliteSaver as a guide.
Hi - I am writing a custom checkpoint saver to save checkpoints to session storage or local storage in the browser. I would like to write tests in Jest as I develop it, but when I run jest, it tells me:
I am able to write a test outside of jest using Typescript with assert statements, and running it with
tsx
.I would prefer to include this test with our suite of Jest tests, and to be able to use Jest.
Any suggestions for being able to test my custom checkpoint saver with Jest?
Also, any advice about creating a checkpoint saver that uses session storage or local storage? I am using the SqliteSaver as a guide.
Thanks!