Skip to content

test: cover theme helpers#45

Closed
gaoflow wants to merge 1 commit into
StableRoute-Org:mainfrom
gaoflow:test/theme-16-helpers
Closed

test: cover theme helpers#45
gaoflow wants to merge 1 commit into
StableRoute-Org:mainfrom
gaoflow:test/theme-16-helpers

Conversation

@gaoflow

@gaoflow gaoflow commented Jun 22, 2026

Copy link
Copy Markdown

Summary

  • add tests for readTheme, writeTheme, and effectiveTheme
  • cover valid, missing, and invalid localStorage values
  • cover explicit light/dark themes and system theme resolution through mocked matchMedia
  • cover SSR-safe branches where window is unavailable

Closes #16

Tests

  • npm test -- src/lib/__tests__/theme.test.ts --runInBand
  • npm run lint
  • npm test -- --runInBand
  • npm test -- --coverage --runInBand
  • npm run build

Coverage note: lib/theme.ts reports 100% statement, branch, function, and line coverage in the coverage run.

@mikewheeleer

Copy link
Copy Markdown
Contributor

thanks for jumping in @gaoflow! 🙏 we assign issues before work starts so two people don't build the same thing, and #16 isn't assigned to you. please grab an open unassigned issue and PR against that. closing this one for now, hope to see you back 💪

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.

Add tests for the theme persistence and effective-theme resolution helpers

2 participants