Add Playwright tests and Vitest coverage thresholds for SDK#327
Add Playwright tests and Vitest coverage thresholds for SDK#327AugistineCreates wants to merge 2 commits into
Conversation
|
@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. |
|
@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! 🚀 |
Miracle656
left a comment
There was a problem hiding this comment.
Thanks for tackling the coverage gate (#254) and browser matrix (#253). A few blocking issues need to be resolved before this can land:
-
This branch is based on
mainfrom before #315 merged, and it reverts that work. Thesdk/package.jsondiff removes the./reactexport subpath and the@tanstack/react-querypeerDependency that #315 added. Merging this would break the just-landed wagmi-style hooks. Please rebase onto the latestmain. -
.github/workflows/ci.ymlindentation 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. -
Jest vs Vitest mismatch. The SDK's tests run on Jest (
"test": "jest", jest config,ts-jest). Addingvitest run --coveragewith 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. -
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'sundefined— so it doesn't actually exercise the WebAuthn happy-path, and will likely fail. AlsowebServer.command: 'npm run dev'has no correspondingdevscript insdk/, so Playwright can't boot the server. The matrix needs a real page that loads the bundled SDK and runs the happy-path. -
fail_ci_if_error: trueon the Codecov step requires aCODECOV_TOKENsecret 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!
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
sdk/vitest.config.tsandfrontend/wallet/vitest.config.tswithcoveragesettings andthresholdsof 70 % for statements, branches, functions, and lines..github/workflows/ci.yml) to run Vitest with coverage and fail the build if any threshold is not met.frontend/wallet/vitest.config.ts(new) and updatedsdk/vitest.config.ts(new content) to enable coverage collection.frontend/wallet/package.jsonandsdk/package.jsonscripts for running tests with coverage.sdk/playwright.config.ts,sdk/tests/browser-matrix.spec.tsfor browser‑matrix testing.README.mdwith a Codecov badge showing current coverage percentage.coverage‑thresholds.This PR brings automated coverage enforcement to prevent future coverage regressions and provides a visible badge for the project’s health.