test(miner-extension): bring the browser extension under a real coverage gate (#4865) - #5644
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-13 18:44:43 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|

Closes #4865
Summary
apps/gittensory-miner-extensionwas excluded from Codecov via the blanketapps/**ignore, and its existing roottest/unit/miner-*.test.tssuites run source through anode:vmharness that v8 cannot attribute coverage to.mainin test(miner-ui): bring the miner-ui under a real coverage gate #5613 (apps/gittensory-miner-ui/vitest.config.ts+npm test --coverage).background.js,opportunity-badge.js, andtoolbar-badge.jsdirectly (via the existing__GITTENSORY_MINER_EXTENSION_TEST__hook) so v8 attributes real coverage, with measured baseline thresholds enforced bynpm test.Change
apps/gittensory-miner-extension/vitest.config.ts— v8 coverage scoped to the three covered source files; thresholds set at a measured baseline (98/94/98/98) with buffer below the wired-day numbers.apps/gittensory-miner-extension/test/— 19 tests across:toolbar-badge.test.ts— pure state map (computeToolbarBadge)opportunity-badge.test.ts— lookup, formatting, markup escapingbackground.test.ts— issue context, sync, message routing, toolbar badge wiring, alarms/lifecycleapps/gittensory-miner-extension/package.json—testscript →vitest run --coverage; addsvitestdevDependency.package.json—ui:testnow runs@jsonbored/gittensory-miner-extension run test.test/unit/codecov-policy.test.ts— regression guard that both miner-ui and miner-extension have app-local coverage gates wired intoui:test.Deferred scope (issue still open after merge)
content.jsandoptions.jsneed a jsdom mount harness before coverage attribution is meaningful — deliberately left for a follow-up.apps/**ignore is unchanged; measurement is via app-local vitest thresholds (same pattern as test(miner-ui): bring the miner-ui under a real coverage gate #5613), notcodecov/patch.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not touchsite/,CNAME, or**/lovable/**.mainvia test(miner-ui): bring the miner-ui under a real coverage gate #5613).Validation
git diff --checknpm run actionlint(not run — no.github/workflows/**changes)npm run typecheck(not run — nosrc/**changes)npm run test:coverage(full unsharded gate — run before push)npm run test:workers(not run — no Workers pool changes)npm run build:mcp/npm run test:mcp-pack(not run — no MCP changes)npm run ui:openapi:check(not run — no OpenAPI changes)npm run ui:lint/npm run ui:typecheck/npm run ui:build(run vianpm run test:cibefore push)npm audit --audit-level=moderatenpm --workspace @jsonbored/gittensory-miner-extension run test— 19 passing; coverage 100% stmts / 95.79% branches / 100% funcs / 100% lines over configured floornpm run test -- --run test/unit/codecov-policy.test.ts— 5 passingIf any required check was skipped, explain why:
apps/**andtest/**only — outside Codecov-measuredsrc/**/lib/**, so nocodecov/patchobligation. The new gate is the extension's own vitest threshold. Fullnpm run test:cishould still be run locally before push.Safety
UI Evidence
No visible UI or extension-behavior change. This PR only adds a test suite, coverage-gate config,
ui:testwiring, and README notes — same as the miner-ui coverage-gate PR #5613. No screenshots required.Notes
test/unit/miner-*.test.tsVM-based behavior tests are left in place; the new app-local suite's role is coverage instrumentation the VM harness structurally cannot provide.content.js/options.jsget covered.Files to commit