chore(test): add coverage threshold, missing tests, and CI coverage summary
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- github-actions, typescript
Research direction
Start with vitest.config.ts, src/utils/theme.test.ts, src/utils/theme.ts, src/test/mock.ts, src/test/index.ts, and .github/workflows/ci.yml; compare the referenced Playground PR for context. Run the existing Vitest suite and inspect its current coverage baseline. Done means the requested tests, globals, configurable proxy, coverage thresholds, and GitHub Actions summary work together in CI.
Written by the indexing model from the issue text.
Description
Background
When the edge-apps-library was extracted from Screenly/Playground, several test and CI improvements developed in Playground PR #644 were never ported over. This issue tracks what still needs to be done.
Missing items
1. Coverage threshold in vitest.config.ts
vitest.config.ts has no coverage configuration. The thresholds below are set just above the current baseline (functions ~67%, lines ~21%) so they pass immediately and can be raised in follow-up PRs as coverage improves:
// vitest.config.ts
coverage: {
provider: 'v8',
thresholds: {
functions: 65,
lines: 20,
branches: 75,
},
reporter: ['text', 'lcov'],
},
The intent is to ratchet these numbers up incrementally, not to hit a high target in one go.
2. fetchLogoImage and setupBranding tests missing from theme.test.ts
src/utils/theme.ts exports fetchLogoImage and setupBranding, but src/utils/theme.test.ts has no coverage for either. Cases to cover:
fetchLogoImage:
- Fetches and base64-encodes SVG images
- Returns the original URL for PNG and JPEG images (detected via magic bytes)
- Throws on HTTP failure
- Throws on unknown image type
setupBranding:
- Sets up complete branding (colors + logo URL) when fetch succeeds
- Converts empty
logoUrltoundefinedwhen all fetch attempts fail
3. corsProxyUrl parameter on createMockScreenly / setupScreenlyMock
cors_proxy_url is currently hardcoded as 'http://localhost:8080' in createMockScreenly. Tests for proxy-dependent code (e.g. setupBrandingLogo) need to supply a custom proxy URL. Proposed change to src/test/mock.ts:
export function createMockScreenly(
metadata: Partial<ScreenlyMetadata> = {},
settings: Partial<ScreenlySettings> = {},
corsProxyUrl = 'http://localhost:8080', // add this
): ScreenlyObject
export function setupScreenlyMock(
metadata: Partial<ScreenlyMetadata> = {},
settings: Partial<ScreenlySettings> = {},
corsProxyUrl?: string, // add this
): ScreenlyObject
4. global.FileReader missing from test setup
src/test/index.ts sets up jsdom globals but does not expose FileReader. SVG-processing tests (which rely on Blob + FileReader) fail without it. Add to src/test/index.ts:
global.FileReader = window.FileReader
5. CI coverage summary in GitHub Actions
The CI workflow (.github/workflows/ci.yml) runs tests but does not report coverage output. Add a step that:
- Cleans the
coverage/directory before the test run - Pipes test output through
tee - Appends a Markdown coverage table to
$GITHUB_STEP_SUMMARYafter the run
References
- Source PR (Playground): https://github.com/Screenly/Playground/pull/644
- Related migration PR: https://github.com/Screenly/Playground/pull/765
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 0
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·