Skip to content

Local Dev & Testing

You can mock the Exnest AI API for local development and testing.

Use your favorite testing library (Jest, Pytest) to mock the client responses.

Quick notes to reproduce and verify the SDK locally, and to avoid runtime import errors when consuming the package from other projects.

Run the TypeScript build (generates dist/):

Terminal window
npm run build

Run the bundled tests (this project uses Bun for unit tests):

Terminal window
# if you have Bun installed
bun test

Node runtime smoke test (included in the repo) — verifies dist/index.js can be required by Node:

Terminal window
node test/node-runtime.test.js

Install the SDK into another local project without publishing:

Using a tarball (recommended for quick verification):

Terminal window
# from the sdk-exnestai root
npm pack
# in the other project folder
npm install /path/to/@exnest-dev-ai-<version>.tgz

Using npm link for development across local projects:

Terminal window
# in sdk-exnestai
npm link
# in your consumer project (e.g. chat-html)
npm link @exnest-dev/ai