Tutorial: Testing & Debugging
Debug Vant issues and write tests for your agents
Debug Mode
Enable Debug
Debug logging is always enabled in the vant all server modes:
# MCP server with debug output
vant mcp
# Same for the REST API or both
vant api
vant all
For a standalone MCP server process:
# HTTP server mode on a chosen port
node bin/mcp.js --server --port 3457
# Or stdio mode for a single AI client
node bin/mcp.js --stdio
Debug Commands
# Health check (quiet output with -q)
vant health
# Sync status
vant sync --status
# Pull manually
vant sync --pull
Common Issues
Brain Won’t Load
# Check brain files
ls -la models/public/
# Check system health
vant health
Sync Fails
# Pull manually
vant sync --pull
# Check token
echo $GITHUB_TOKEN | head -c 5
Locked Brain
# Check lock status
vant lock status
# Force release (admin)
vant lock force
Write Tests
Unit Test
The repo’s tests are plain-Node scripts with assert (no mocha/jest runner). A unit test looks like:
const assert = require('assert');
const vant = require('vant-os');
(async () => {
const inited = await vant.init({ name: 'Test' });
assert(!inited.error);
const thought = await vant.think('test query');
assert(Array.isArray(thought.insights));
const learned = await vant.learn('test', 'content');
assert(learned.success);
process.exit(0);
})().catch(e => { console.error(e); process.exit(1); });
Run Tests
There are no test:watch/test:coverage npm scripts. The real surface:
# Smoke (build-test)
npm test
# Full runner (all suites)
node tests/runner.js
# Coverage summary
node tests/coverage.js
# The CI battery end to end
node tests/ci.js
# One suite
node tests/brain.test.js
Related
See CI for CI setup.