Skip to content

test(nativ): coverage script and floors, tests for the service worker, routes and utils modules - #272

Merged
arrzdev merged 1 commit into
mainfrom
test/nativ-coverage-floor
Nov 2, 2026
Merged

arrzdev merged 1 commit into
mainfrom
test/nativ-coverage-floor

Conversation

@arrzdev

@arrzdev arrzdev commented Nov 2, 2026

Copy link
Copy Markdown
Owner

What and why

packages/nativ ran its tests with no coverage report, while the game app, the backend and the rules engine already report coverage. This adds test:coverage (@vitest/coverage-v8 4.1.12, the version the game app uses) with floors set just under today's totals. The CI gate runs test:coverage instead of test for any package that has the script, so the floor gates merges with no workflow change.

src/shell/service-worker-shell.ts is left out of coverage. It imports virtual:nativ/pwa-register, which only the nativ Vite plugin resolves, so the coverage pass cannot load it outside an app build.

It also adds unit tests for the three least covered folders by lines. components/drawer was also at 0%, but it is a large gesture engine and is better covered in its own PR.

Folder Lines before Lines after
sw/ (service worker routes, strategies, lifecycle, warm-up) 0% 100%
routes/ (rootRoute) 0% 100%
utils/ (cn, clamp, platform checks, vibrate polyfill) 3.44% 96.55%
Package total 11.52% 15.00%

Floors: lines, branches, functions and statements all at 14 (measured: 15.00 / 14.52 / 14.85 / 14.61). These changes only add tests. No source behaviour changes.

How to verify

pnpm --filter @repo/nativ test:coverage   # 150 tests pass, totals above the floors

UI quality gate

Does not apply: these changes only add tests and config, with no rendered UI.

@arrzdev
arrzdev merged commit 2e0737d into main Nov 2, 2026
5 checks passed
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