Testing Custom Actions
Unit tests give custom Hexabot actions a stable contract before the action is published or reused across projects. A good action test suite should cover the workflow-facing contract, the execution beh
What to Test
Install Jest Dependencies
npm install -D jest @swc/core @swc/jest @types/jest typescriptpnpm add -D jest @swc/core @swc/jest @types/jest typescript{
"scripts": {
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage"
}
}Jest Configuration
Test File Layout
Instantiate an Action
Test the Schema Contract
Test Execution with Mocked Context Services
Mock HTTP Calls
Test Failure Paths
Test Memory Actions
Test Conversational Actions
Test Bindings
Test Safe Logging
Run Tests Before Publishing
Checklist
Last updated
Was this helpful?