qie-forge/apps/web/vitest.config.mts
caelum0x 33ba5c3475 fix: WalletProvider never subscribed to wallet accountsChanged/chainChanged
Eip1193Provider has always declared the standard on/removeListener event
hooks, but nothing in the app ever called them. Once connect() set
address/chain once, the UI kept using a stale address forever after the
user switched accounts or networks inside their wallet post-connect -
every subsequent vault/pool read and wallet-signed write kept targeting
the wrong account with no indication anything changed.

Wires accountsChanged (sync address, clear on wallet-side disconnect) and
chainChanged (drop the stale address + surface an error, forcing a
reconnect that re-validates the chain) through WalletProvider. Adds a
real regression test driving the actual component against a mock
EIP-1193 provider - confirmed it fails on the pre-fix code and passes
post-fix. First test suite for apps/web (vitest + jsdom + testing-library,
wired into the root test/lint scripts alongside core/cli).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-29 13:49:34 +03:00

16 lines
293 B
TypeScript

import path from "node:path";
import { defineConfig } from "vitest/config";
export default defineConfig({
resolve: {
alias: {
"@": path.resolve(__dirname, "."),
},
},
test: {
environment: "jsdom",
testTimeout: 20_000,
include: ["test/**/*.test.tsx"],
},
});