Setup
1
Install our test library
or see our demo repo if you don’t have a project to try it on
2
Initialize Magnitude
tests/magnitude
with:magnitude.config.ts
: Magnitude test configuration fileexample.mag.ts
: An example test file
3
Configure LLM
The easiest way to set up an LLM for Magnitude is to set the
ANTHROPIC_API_KEY
environment variable. Sonnet 4 will be used by default. See LLM Configuration for more details.Running tests
Run your Magnitude tests with:*.mag.ts
pattern. If the agent finds a problem with your app, it will tell you what happened and describe the bug!
To run many tests in parallel, add -w <workers>
To learn more about different options for running tests see here.