Skip to content

Add Playwright tests and Vitest coverage thresholds for SDK#327

Open
AugistineCreates wants to merge 2 commits into
Miracle656:mainfrom
AugistineCreates:coverage-thresholds
Open

Add Playwright tests and Vitest coverage thresholds for SDK#327
AugistineCreates wants to merge 2 commits into
Miracle656:mainfrom
AugistineCreates:coverage-thresholds

Conversation

@AugistineCreates

Copy link
Copy Markdown

This pr closes #254

Add Vitest coverage thresholds (≥ 70 % for statements, branches, functions, and lines) to the SDK and wallet packages, integrate the thresholds into the CI pipeline, and add a Codecov badge to the root README.

Changes included

  • Updated sdk/vitest.config.ts and frontend/wallet/vitest.config.ts with coverage settings and thresholds of 70 % for statements, branches, functions, and lines.
  • Modified CI workflow (.github/workflows/ci.yml) to run Vitest with coverage and fail the build if any threshold is not met.
  • Added frontend/wallet/vitest.config.ts (new) and updated sdk/vitest.config.ts (new content) to enable coverage collection.
  • Added frontend/wallet/package.json and sdk/package.json scripts for running tests with coverage.
  • Added sdk/playwright.config.ts, sdk/tests/browser-matrix.spec.ts for browser‑matrix testing.
  • Updated README.md with a Codecov badge showing current coverage percentage.
  • Committed all new files and changes in a single commit on branch coverage‑thresholds.

This PR brings automated coverage enforcement to prevent future coverage regressions and provides a visible badge for the project’s health.

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@AugistineCreates is attempting to deploy a commit to the miracle656's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 23, 2026

Copy link
Copy Markdown

@AugistineCreates Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Miracle656 Miracle656 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling the coverage gate (#254) and browser matrix (#253). A few blocking issues need to be resolved before this can land:

  1. This branch is based on main from before #315 merged, and it reverts that work. The sdk/package.json diff removes the ./react export subpath and the @tanstack/react-query peerDependency that #315 added. Merging this would break the just-landed wagmi-style hooks. Please rebase onto the latest main.

  2. .github/workflows/ci.yml indentation is broken. The new steps (- name: Run Vitest coverage, etc.) are indented 4 spaces, but the existing steps in that job are at 6 spaces — so they're misnested and the workflow is invalid YAML. They need to line up with the surrounding - run: steps.

  3. Jest vs Vitest mismatch. The SDK's tests run on Jest ("test": "jest", jest config, ts-jest). Adding vitest run --coverage with a hard 70% threshold will run against a different (or empty) test set and fail. Either compute coverage from the existing Jest setup (jest --coverage + coverageThreshold), or migrate the suite to Vitest deliberately — but don't run both.

  4. The browser-matrix test is a no-op. page.evaluate(() => typeof useInvisibleWallet === 'function') references a Node-side import inside the browser page context, where it's undefined — so it doesn't actually exercise the WebAuthn happy-path, and will likely fail. Also webServer.command: 'npm run dev' has no corresponding dev script in sdk/, so Playwright can't boot the server. The matrix needs a real page that loads the bundled SDK and runs the happy-path.

  5. fail_ci_if_error: true on the Codecov step requires a CODECOV_TOKEN secret that isn't configured — this will fail CI on its own.

Once it's rebased and the CI/test wiring actually runs green, I'll re-review. Thanks!

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.

Coverage threshold gate at 70%

2 participants