test(miner-extension): bring the browser extension under a real coverage gate - #5641
test(miner-extension): bring the browser extension under a real coverage gate#5641carlh7777 wants to merge 1 commit into
Conversation
- Updated the `ui:test` script in `package.json` to include tests from the `@jsonbored/gittensory-miner-extension` workspace, ensuring comprehensive coverage. - Added a new `test` script in the `apps/gittensory-miner-extension/package.json` to run tests using Vitest, improving the testing framework. - Expanded the README.md to document the testing process and coverage details for the miner extension, providing clarity for developers. - Introduced Vitest configuration in `vitest.config.ts` to streamline test execution and coverage reporting. - Created multiple test files for various components, including `background.test.js`, `content.test.js`, and `opportunity-badge.test.js`, to ensure robust testing of the miner extension's functionality.
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 LoopOver review result - reject/close recommendedReview updated: 2026-07-13 18:29:43 UTC
🛑 Suggested Action - Reject/Close
Review summary Nits — 5 non-blocking
Why this is blocked
📋 Copy for AI agents — paste into your coding agentFlagged checks (non-blocking)
Linked issue satisfactionPartially addressed 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.
|
|
Gittensory is closing this pull request on the maintainer's behalf (Linked issue overlaps another open PR; duplicate of another open PR). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |

Summary
apps/gittensory-miner-extensionwas excluded from all coverage via the rootvitest.config.tsblanketcoverage.exclude: ["apps/**"], and its only tests (test/unit/miner-*.test.ts) ran the source through anode:vmharness that v8 cannot attribute coverage to. This PR gives the extension a real, measured coveragegate over every shipped script, completing the extension half of #4865 (the miner-ui half shipped in #5613).
apps/gittensory-miner-extension/test/) that imports thereal source files directly — via the source's own
globalThis.__GITTENSORY_MINER_EXTENSION_TEST__internalshook — so v8 attributes true coverage. 85 tests across all five scripts:
background.js,content.js,opportunity-badge.js,options.js,toolbar-badge.js.content.js,options.js) run under jsdom via a per-file// @vitest-environment jsdomdocblock; the rest run in Node.apps/gittensory-miner-extension/vitest.config.ts(v8;includescoped to the five scripts) andchanges the app's
testscript tovitest run --coverage.testinto the rootui:test, so the gate runs wherevernpm run ui:test/npm run test:cialready run — no new CI step.
Coverage is 100% statements / 97.89% branches / 100% functions / 100% lines. The only uncovered branches are the
four
if (globalThis.__GITTENSORY_MINER_EXTENSION_TEST__)test-only export guards (one per script), whose falsearm can never run while the suite's setup file has that flag set. Thresholds are set to that measured baseline
(100 / 97 / 100 / 100) — a regression floor, not an aspirational ratchet.
Closes #4865.
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.md; does not reintroduce GitHub Pages, VitePress,site/, orCNAME.brings the second and final app under measured coverage, satisfying the deliverable
("Both apps under real coverage measurement where technically feasible").
Validation
npm --workspace @jsonbored/gittensory-miner-extension run test— 85 passing; 100% stmts / 97.89% branches/ 100% funcs / 100% lines, over the configured floor.
npm run ui:test— full UI chain green (gittensory-ui 244, miner-ui 111, miner-extension 85).Safety
apps/gittensory-miner-extension/**; touches nosrc/**,no OpenAPI/MCP/wrangler/migrations, so no generated artifacts are affected.
Notes
node:vm-based tests in roottest/unit/remain as behavior tests; this app-local suite's roleis the coverage instrumentation the
vmharness structurally cannot provide.