t3-stack: v6.2.1Next.js: v12.3.1jest: v23.3.1Next.js docs on the jest setup (with the Rust Compiler) https://nextjs.org/docs/testing#setting-up-jest-with-the-rust-compilerwagmi client so I had to import a few packages from wagmi to my test file like so:import { Client, createClient, WagmiConfig, useConnect } from "wagmi";.../node_modules/wagmi/dist/index.js:2
import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister";
^^^^^^
SyntaxError: Cannot use import statement outside a module
jest.config.js file like filters and transformIgnorePatters but nothing helped with transforming the wagmi esm enabled library.jest docs and started reading - I can fix it using the ECMAScript Modules support https://jestjs.io/docs/ecmascript-modulesextensionsToTreatAsEsm: [".ts", ".tsx"] to my jest.config.js filenodejs flag:NODE_OPTIONS=--experimental-vm-modules npx jest -- src/__tests__/Wallet.test.tsx jest docs again and read on how to mock modules in ESM mode. https://jestjs.io/docs/ecmascript-modules#module-mocking-in-esmimoprt wagmi since it's ESM enabled.
