Skip to content

Commit 02e341f

Browse files
Shawclaude
andcommitted
fix(cloud-tests): bun-compat vi.mock + drop useless continue
direct-wallet-payments.integration.test.ts used Vitest's `vi.mock(id, async (importOriginal) => {...})` callback form. bun-test's vi shim doesn't pass importOriginal — calling it throws TypeError and crashes the unit suite before any test runs. Switched all four affected mocks to `async () => { const actual = (await vi.importActual("X")) as typeof import("X"); ... }` which works under both Vitest and bun-test. payout-fork.integration.test.ts had a useless `continue` at the end of a try/catch body (biome noUselessContinue). Removed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2894572 commit 02e341f

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

packages/cloud-shared/src/lib/services/__tests__/direct-wallet-payments.integration.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ interface FakeTx {
5656

5757
const chainTxs = new Map<string, FakeTx>();
5858

59-
vi.mock("viem", async (importOriginal) => {
60-
const actual = await importOriginal<typeof import("viem")>();
59+
vi.mock("viem", async () => {
60+
const actual = (await vi.importActual("viem")) as typeof import("viem");
6161
return {
6262
...actual,
6363
createPublicClient: () => ({
@@ -152,8 +152,8 @@ const solanaTestState = vi.hoisted(() => ({
152152
parsedTxOverride: null as unknown,
153153
}));
154154

155-
vi.mock("@solana/spl-token", async (importOriginal) => {
156-
const actual = await importOriginal<typeof import("@solana/spl-token")>();
155+
vi.mock("@solana/spl-token", async () => {
156+
const actual = (await vi.importActual("@solana/spl-token")) as typeof import("@solana/spl-token");
157157
return {
158158
...actual,
159159
getAccount: vi.fn(async (_connection: unknown, ata: { toBase58(): string }) => {
@@ -171,8 +171,8 @@ vi.mock("@solana/spl-token", async (importOriginal) => {
171171
};
172172
});
173173

174-
vi.mock("@solana/web3.js", async (importOriginal) => {
175-
const actual = await importOriginal<typeof import("@solana/web3.js")>();
174+
vi.mock("@solana/web3.js", async () => {
175+
const actual = (await vi.importActual("@solana/web3.js")) as typeof import("@solana/web3.js");
176176
return {
177177
...actual,
178178
Connection: class FakeConnection {

packages/cloud-shared/src/lib/services/__tests__/payout-fork.integration.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ async function findHolder(rpcUrl: string, chain: Chain): Promise<Address | null>
158158
if (window.length > 0) break;
159159
} catch {
160160
// RPC may still rate-limit; try the next chunk.
161-
continue;
162161
}
163162
}
164163
for (const log of logs) {

0 commit comments

Comments
 (0)