Skip to content

Add test coverage analysis with prioritized recommendations#3

Merged
kevin-sakemaer merged 5 commits intomainfrom
claude/analyze-test-coverage-aJDpa
Feb 7, 2026
Merged

Add test coverage analysis with prioritized recommendations#3
kevin-sakemaer merged 5 commits intomainfrom
claude/analyze-test-coverage-aJDpa

Conversation

@kevin-sakemaer
Copy link
Copy Markdown
Contributor

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

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
@kevin-sakemaer kevin-sakemaer merged commit 09423b1 into main Feb 7, 2026
1 of 2 checks passed
@kevin-sakemaer kevin-sakemaer deleted the claude/analyze-test-coverage-aJDpa branch February 7, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants