This guide provides instructions for testing the Inworld AI Web SDK.
To run unit tests for all packages, use the following command:
yarn test
Currently, this command only runs tests for @inworld/web-core
, but future versions may include additional packages.
Note that this repository uses Yarn 2.
If you're testing unpublished changes to the Inworld package, you can manually link @inworld/web-core
by following these steps:
- In the root directory of the package, run:
~/inworld-web-sdk $ yarn install && yarn build
- In your application directory (e.g.,
inworld-web-sdk/examples/chat
), link the@inworld/web-core
package with:
~/inworld-web-sdk/examples/chat $ yarn link ../../packages/web-core
For more details on linking, consult the yarn link
documentation:
yarn link --help
If your application uses Yarn 1.x, link the package with:
yarn link @inworld/web-core
Manual linking works well for development but may not cover all scenarios. For more comprehensive testing, create a compressed archive with the following command:
~/inworld-web-sdk/web-core $ yarn pack --filename inworld-web-core-test.tgz
After creating the archive, add it to your application with:
~/inworld-web-sdk/examples/chat $ yarn add ../../packages/web-core/inworld-web-core-test.tgz