Add test coverage analysis with prioritized recommendations#3
Merged
kevin-sakemaer merged 5 commits intomainfrom Feb 7, 2026
Merged
Add test coverage analysis with prioritized recommendations#3kevin-sakemaer merged 5 commits intomainfrom
kevin-sakemaer merged 5 commits intomainfrom
Conversation
Systematically map all source modules against test files across the three packages (spark, spark_cli, spark_generator) and identify critical coverage gaps including untested security-critical code in static_handler.dart and the entirely untested SparkRequest class. https://claude.ai/code/session_01Q9vUgDFRmdRfeRimiVeSpv
- SparkRequest: 40+ tests covering parameter extraction, cookie parsing, multipart, mediaType, withContext/withPathParams, and edge cases - static_handler: 20+ tests covering file serving, MIME types, directory traversal prevention, ETag caching, gzip compression, directory listing - BuildRunnerParser: 20+ tests covering all 5 regex patterns, multi-line error buffering, clear/finalize lifecycle, and sequential error handling - annotations: comprehensive tests for Page, Component, Endpoint (all 12 fields), all 10 validators, OpenApi, SecurityScheme (4 constructors), Parameter (all 12 fields), ExternalDocumentation - page_generator: 10 new tests for multi-method pages, PageRedirect, PageError, middleware pipeline, multiple path params, CSP nonce - generator_helpers: tests for parsePathParams and convertToShelfPath with colon, bracket, and mixed parameter styles https://claude.ai/code/session_01Q9vUgDFRmdRfeRimiVeSpv
Dart's Uri.parse normalizes ../ segments before the handler sees the path, so the traversal check returns 404 (not found) rather than 403 (forbidden). The test now verifies the secret content is never leaked regardless of mechanism, and adds a second test using a subdirectory base path to validate the defense-in-depth check. https://claude.ai/code/session_01Q9vUgDFRmdRfeRimiVeSpv
The argument to add() was `throw ''` which executed before add() could throw UnsupportedError. Cast to List and pass null instead. https://claude.ai/code/session_01Q9vUgDFRmdRfeRimiVeSpv
The list is typed List<DevError>, so passing null throws a TypeError before the unmodifiable check. Use DevError.build() to create a properly-typed value that triggers UnsupportedError from the unmodifiable list. https://claude.ai/code/session_01Q9vUgDFRmdRfeRimiVeSpv
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.
Systematically map all source modules against test files across
the three packages (spark, spark_cli, spark_generator) and identify
critical coverage gaps including untested security-critical code
in static_handler.dart and the entirely untested SparkRequest class.
https://claude.ai/code/session_01Q9vUgDFRmdRfeRimiVeSpv