Skip to content

test: improve overall coverage from 57.6% to 60.6%#108

Merged
corylanou merged 3 commits into
mainfrom
feat/improve-test-coverage
Mar 16, 2026
Merged

test: improve overall coverage from 57.6% to 60.6%#108
corylanou merged 3 commits into
mainfrom
feat/improve-test-coverage

Conversation

@corylanou

Copy link
Copy Markdown
Member

Summary

Adds targeted test coverage for undertested packages to bring overall statement coverage from 57.6% to 60.6%, crossing the 60% ship threshold.

Related Issue

N/A — Coverage improvement initiative.

Changes

  • blog package (8.6% → 36.2%): Added tests for highlight (NewHighlighter, Highlight, CSS, getLexer, escapeHTML), SEO (OpenGraphTags, TwitterCardTags, JSONLD, escapeAttr), config (DefaultConfig, LoadConfig), article helpers (IsPublished, URL, FormattedDate, ISODate, calculateReadingTime, stripHTML, stripDetailsBlocks), templates (IsBuiltinTheme, ListBuiltinThemes, parseYAML), and validation (validateOutputDir)
  • atomx package (52.9% → 100%): Added tests for Atom.String, Atom.Atom, Atom.Is, IsAtom, Headings, Inlines
  • binding package (62.3% → 66.7%): Added tests for ErrPath.Error and ErrPath.Is
  • Root package (76.8% → 77.1%): Added tests for ErrIsNil, WrapNodeErr, errForJSON, toError, Text methods, toType
  • Fixed failing test: Updated gold file for Go 1.25 go doc output change ([Context.Err]Context.Err)

Test Plan

  • Tests pass (go test ./...)
  • Manually tested with hype documents
  • Documentation updated (if applicable)

Breaking Changes

None

Add tests for blog (highlight, SEO, config, article, templates, validation),
atomx (Atom methods, Headings, Inlines — now 100%), binding (ErrPath), and
root package (errors, text, type utilities). Fix failing gold file for Go 1.25
go doc output change (removed doc-link brackets).
@corylanou corylanou force-pushed the feat/improve-test-coverage branch from 4645696 to 9da2123 Compare March 16, 2026 17:10
The CI runs Go 1.25 (from go.mod) which still outputs [Context.Err]
with doc-link brackets. Go 1.26 (local) drops the brackets. Keep the
gold file matching CI's Go version.
@corylanou corylanou merged commit ce140cc into main Mar 16, 2026
3 checks passed
@corylanou corylanou deleted the feat/improve-test-coverage branch March 16, 2026 17:15
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.

1 participant