You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(test): standardize log capture on useCaptureLog (#287)
* refactor(test): standardize log capture on useCaptureLog and stabilize integration harness
Replace ad-hoc log spy patterns across every command and lib test with the
useCaptureLog helper. Refactor log.ts and spinner.ts so the helper can hook
in cleanly, drop unused test-helper imports as a side effect.
Add a harness test covering the lazy config-module loader so each test gets
a fresh instance.
* fix(review): address PR #287 feedback
- remove unused log capture accessor
- enforce integration harness import invariant with AST check
`log.data()` writes to **stdout** — this is what gets piped (e.g., `clerk apps list | jq`). Everything else writes to **stderr** as UI for humans. Never mix these.
@@ -57,15 +58,27 @@ log.info("Linked to `my-app` on `development`");
57
58
58
59
## Testing log output
59
60
60
-
Use `captureLog()` from `src/test/lib/stubs.ts`. Capture is scoped via `AsyncLocalStorage`— no teardown needed:
61
+
Use `useCaptureLog()` from `src/test/lib/stubs.ts` at file or `describe` scope. It registers `beforeEach`/`afterEach` hooks that install a fresh buffer for each test and clear it after — no per-test wiring needed:
0 commit comments