test(graphFormats): cover fromMermaid parser error paths#171
Merged
Conversation
Three new tests in the existing `fromMermaid error paths` block: - Read label with no bracketed list (graphFormats.ts:379) - Write/move cell-count mismatch (graphFormats.ts:396) - Backslash-escape branch in `stripBrackets` (graphFormats.ts:355-356) Coverage: statements 98.29 β 98.72 (+0.43), branches 95.35 β 96.13 (+0.78), graphFormats.ts 96.42/90.62 β 98.8/94.79. Addresses the Coveralls "coverage fell" status on PR #167 (v7 β master draft) after v7-alpha.1 work landed. Remaining uncovered branches in v7 code are defensive fallbacks (graph.ts:173/209, State.ts:463-464, introspection.ts:121) β not worth synthetic tests.
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
Three new tests in the existing
fromMermaid error pathsdescribe block, covering parser-error branches added during the v7 emit overhaul that were never exercised:graphFormats.ts:379)graphFormats.ts:396)stripBrackets(graphFormats.ts:355-356)Why
Coveralls reported a coverage drop on PR #167 (v7 β master draft) after v7-alpha.1's emit overhaul landed. The new parser error paths were live but untested β locally clean (above the 97/90/95/97 floors in
vitest.config.ts), but enough of a delta vs. master that Coveralls' no-drop check failed.Coverage delta
graphFormats.tsstmtsgraphFormats.tsbranchesWhat's NOT covered
Remaining uncovered branches in v7 code are defensive fallbacks not worth synthetic tests:
graph.ts:173, 209β fallback returns inparsePatternString/parseWriteSymbolLabelfor malformed inputsState.ts:463-464β catch for unboundReference.refthrow duringtoGraphwalkintrospection.ts:121βif (node)guard in cycle detectionTest plan
npm testβ all tests pass (425/425, +3)npm run test:coverageβ numbers abovenpm run lintβ cleannpm run typecheckβ clean