Repository navigation
test: add Vitest suite, required Tests check and testing strategy - #665
Conversation
Vitest 4 with happy-dom at the repo root runs the kit, lambda and CI gate script. 151 tests cover the smart-account authorization path, generic delegator gas and VIP-191 assembly, provider config mapping to Privy and dapp-kit, a real DAppKitProvider mount, dependency-tree identity and the built bundle. The Tests workflow is a single required check that skips in-job only for docs and assets. The skipped Playwright suite and the lambda-only workflow are removed; strategy and follow-ups in docs/testing.md. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The kit never imports valtio; only dapp-kit and dapp-kit-react must share a copy. react, react-dom and react-query keep the kit as anchor. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Before/after:
|
main + this PR |
#663 + this PR | |
|---|---|---|
yarn kit:typecheck |
pass | pass |
yarn kit:build |
pass | pass |
| Tests | 151 / 151 pass | 149 pass, 2 fail |
| Suite duration | 6.5 s | 6.4 s |
The two failures on #663 (deliberate, one cause)
VeChainKitProvider.config.test.tsx › places createOnLogin where the installed Privy version reads itVeChainKitProvider.config.test.tsx › falls back to VeChain's Privy app and a theme-derived accent colour without a privy prop
Both assert the embeddedWallets shape the kit hands to PrivyProvider. On main the kit sets { createOnLogin } (already deprecated in 2.25.0); #663 moves it to { ethereum: { createOnLogin } } because react-auth 3 ignores the top-level key. When #663 rebases on this PR, the two expectations become { ethereum: { createOnLogin: 'users-without-wallets' } } and { ethereum: { createOnLogin: 'all-users' } }. That is the whole diff; it is the test doing its job on the misconfiguration that was previously silent.
What stays green on #663
- The smart-account signing path: EIP-712 builders,
useBuildClauses,PrivyWalletProvider.sendTransaction,useGenericDelegator(fake Thor node + fake delegators), VIP-191 assembly. - The Privy surface the kit imports (
PrivyProvider,usePrivy,useLoginWithEmail/OAuth/Passkey,useCreateWallet,useMfaEnrollment,useSetWalletRecovery) still type-checks against 3.48.0. - Full provider mount with the real
DAppKitProvider, wagmi and cross-app-connect; the built-bundle smoke test; the dependency identity test.
The valtio crash is now guarded
With #663's root valtio@1.13.2 devDependency removed from the merged tree and yarn install re-run, Yarn hoists valtio 2.1.7 to the root and nests 1.13.2 under @vechain/dapp-kit and @vechain/dapp-kit-react separately. Three tests then fail:
moduleIdentity.test.ts › resolves a single copy of 'valtio' across dapp-kit, dapp-kit-react(names the two paths);VeChainKitProvider.mount.test.tsxwithTypeError: Cannot read properties of undefined (reading '3'), the error quoted in chore(deps): upgrade @privy-io/react-auth to 3.48.0 #663;distSmoke.test.tsx › mounts VeChainKitProvider from the bundle.
Note for #663: it also leaves a nested valtio 2.1.7 under packages/vechain-kit/node_modules for @reown/appkit*. The kit never imports valtio and both dapp-kit packages share the root 1.13.2, so that is harmless; the identity test anchors on the dapp-kit pair for this reason.
Coverage totals are only emitted on a fully passing run, so there are none for the #663 run.
|
Size Change: +64 B (0%) Total Size: 9.36 MB
ℹ️ View Unchanged
|
…check Nine tests drive the built next-template in Chromium: VeWorld login, logout, reload, rejected connection, transactions with toast and modal confirmed on chain, rejected signature, message and typed-data signing. VeWorld is a window.vechain v2 shim that signs in Node with a solo genesis key, since the published veworld-mock only speaks the v1 Connex API. The example gains an opt-out mode without a Privy app id and reads the network from the env. The Tests workflow gets a second job, E2E, with the same change gate. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
E2E tier added (23b5e2f)
How VeWorld is driven. dapp-kit 2.3 uses the v2 Workflow. Two findings from building it (recorded in
Still manual (tier 2, needs a Privy test app, test-account OTP and a funded testnet key as secrets): social login/logout/link, smart-account transaction end to end, domain names, mnemonic backup. The doc's "Manual checklist coverage" table maps the maintainers' list item by item. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds a test runner, a unit suite and a VeWorld end-to-end suite to the kit, which had no running tests, with the strategy in
docs/testing.md.Vitest 4 with happy-dom runs three projects under
yarn test: the kit, the lambda tests (moved from Jest, same assertions) and the CI gate script. 151 tests cover the smart-account authorization path (EIP-712 builders,useBuildClauses,PrivyWalletProvider.sendTransactionanduseGenericDelegatoragainst a fake Thor node and fake delegators), gas math, VIP-191 assembly, provider config mapping to Privy and dapp-kit, a full mount with the realDAppKitProvider, dependency-tree identity (the valtio crash) and the built bundle. Coverage floors apply to four hot-spot files.yarn test:e2eruns 9 Playwright tests against the builtnext-templateon a Docker thor-solo: VeWorld login, logout, reload, rejected connection, transactions with toast and modal confirmed on chain, rejected signature, message and typed-data signing. VeWorld is awindow.vechainv2 shim that signs in Node with a solo key; the example gains an opt-out mode without a Privy app id.The
Testsworkflow has two jobs to require,TestsandE2E. Both skip in-job only when every changed file is docs or assets, failing closed, always run on main and need no secrets.Removed: the skipped Playwright suite and its workflow, and the lambda-only workflow. No kit runtime changes; six bugs noticed while testing are listed in the doc. happy-dom replaces jsdom, which cannot start on the pinned Node 20.18.