Two fixes:
1. perf/route.ts was importing request-logger.js via relative path with .js
extension. Next.js webpack can't resolve this — use @/lib/request-logger
alias like all other API routes do. Fixes CI Typecheck and Fresh Onboarding.
2. perf.test.ts and observability-routes.test.ts contained ~100 lines of
inline mock implementations duplicating computeApiStats and parseApiLogs
from core. These are tested in log-reader.test.ts. Removed the duplication:
- perf.test.ts: drop @composio/ao-core mock entirely; use real pure fns
- observability-routes.test.ts: mock request-logger.js at the module
boundary (getRequestStats), replace 9 behavioral tests with 7 focused
HTTP-contract tests (JSON shape, param forwarding, error handling)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| commands | ||
| lib | ||