Internalize reporter implementations into main package#106
Merged
lambdalisue merged 6 commits intomainfrom Feb 1, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR internalizes the JSON and List reporter implementations into the CLI package, removing the external @probitas/reporter dependency and adding snapshot-based test coverage for the new internal reporters.
Changes:
- Replaced
@probitas/reporterimports with internal reporter implementations undersrc/cli/reporter/. - Added internal reporter implementations (
ListReporter,JSONReporter) plus aWriterutility for serialized stream output. - Added reporter test infrastructure and ListReporter snapshot coverage; updated development docs and Deno import mappings.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cli/utils.ts | Switches reporter resolution to internal reporter modules and internal ReporterOptions type. |
| src/cli/utils_test.ts | Updates reporter imports used in resolveReporter tests. |
| src/cli/reporter/writer.ts | Introduces a serialized writer abstraction for reporter output streams. |
| src/cli/reporter/types.ts | Adds internal ReporterOptions type used by CLI reporter resolution and tests. |
| src/cli/reporter/list_reporter.ts | Adds internal ListReporter implementation (detailed console output + summary). |
| src/cli/reporter/list_reporter_test.ts | Adds ListReporter snapshot tests, including multiline error/skip cases. |
| src/cli/reporter/json_reporter.ts | Adds internal JSONLines reporter implementation. |
| src/cli/reporter/json_reporter_test.ts | Adds JSONReporter snapshot test harness invocation. |
| src/cli/reporter/_testkit.ts | Adds shared reporter snapshot test harness + fixtures. |
| src/cli/reporter/snapshots/list_reporter_test.ts.snap | Commits ListReporter snapshots. |
| deno.json | Removes @probitas/reporter import mapping; adds @std/testing/snapshot mapping. |
| deno.lock | Removes locked dependency entries related to @probitas/reporter and updates lock state accordingly. |
| .claude/rules/development.md | Updates custom reporter guidance to align with the new reporter architecture. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 14 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ormat utilities, and test kit
…ations with snapshot tests
…l reporter module
c3900a8 to
7c30468
Compare
…N reporter serialization Replace the stateless `errorReplacer` with a stateful `createReplacer()` factory that tracks the ancestor chain to detect circular object references, uses a WeakSet to detect re-encountered Error instances, and converts BigInt values to strings. Without this, JSON.stringify throws TypeError when scenario results contain BigInt values or circular object graphs.
…ementation - Use WritableStream<Uint8Array> for type safety - Fix Writer debug metrics (correct byteLength calculation, remove incorrect queueDepth) - Remove unreachable default case in getKindChar for exhaustiveness checking - Consolidate reporter options types (ListReporterOptions and JSONReporterOptions now alias ReporterOptions)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Writer, shared formatting utilities, and snapshot test kitListReporterandJSONReporterwith comprehensive test coverage@probitas/reporterdependency with internalsrc/cli/reporter/module"dot","tap") from configurationWhy
Reporters are tightly coupled to the CLI implementation and don't benefit from being external packages. Internalizing them:
Reporterinterface from@probitas/runnerThe implementation is split into 4 logical commits:
Writer(queue-based serialization), shared format utilities, test kitListReporterandJSONReporterwith snapshot testsTest Plan
deno task verify(45 passed, 0 failed)ListReporterproduces correct output (validated via snapshots)JSONReporterproduces correct output (validated via snapshots)