code_test
code_test runs the project’s test suite and maps failures back to named functions in the graph, not just file paths. Use it instead of running the test runner directly.
code_test()code_test(filter="payment")code_test(filter="test_knowledge")Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
filter | string | — | Run only tests whose name or path matches this string |
Output (failure)
Section titled “Output (failure)”Tests: 142 passed, 2 failed
FAIL PaymentService.charge payment.test.ts:44 Expected: Receipt { id: "rcpt_123", ... } Received: null Function: PaymentService.charge (src/services/payment.ts:18)
FAIL AuthService.validate auth.test.ts:91 Error: jwt.verify is not a function Function: AuthService.validate (src/middleware/auth.ts:82)When to use
Section titled “When to use”- After fixing a bug — confirm the fix and check for regressions
- During refactoring — run filtered tests for the module being changed
- As the final step before committing
Workflow
Section titled “Workflow”# Run all testscode_test()
# Run only payment-related testscode_test(filter="payment")
# After seeing a failure, read the broken functioncode_get(name="PaymentService.charge")