From 663347b4dac344927fc1c36b11648dd078cb4ab0 Mon Sep 17 00:00:00 2001 From: Alexandru Cambose Date: Tue, 15 Jul 2025 11:35:07 +0400 Subject: [PATCH 1/2] fix: vitest settings types --- src/sdk/account/decorators/deployGasTank.test.ts | 1 - .../decorators/instructions/buildComposable.test.ts | 1 - src/sdk/account/decorators/withdrawFromGasTank.test.ts | 1 - src/sdk/clients/createBundlerClient.test.ts | 1 - src/sdk/clients/createMeeClient.test.ts | 1 - .../clients/decorators/mee/executeFusionQuote.test.ts | 1 - src/sdk/clients/decorators/mee/getMmDtkQuote.test.ts | 1 - .../clients/decorators/mee/signOnChainQuote.test.ts | 1 - src/sdk/clients/decorators/mee/signPermitQuote.test.ts | 1 - .../smartSessions/toMultichainSmartSessions.test.ts | 1 - src/test/globalSetup.ts | 6 ------ src/test/vitest.shims.d.ts | 10 ++++++++++ 12 files changed, 10 insertions(+), 16 deletions(-) create mode 100644 src/test/vitest.shims.d.ts diff --git a/src/sdk/account/decorators/deployGasTank.test.ts b/src/sdk/account/decorators/deployGasTank.test.ts index 5ec23909..89a3967f 100644 --- a/src/sdk/account/decorators/deployGasTank.test.ts +++ b/src/sdk/account/decorators/deployGasTank.test.ts @@ -16,7 +16,6 @@ import { DEFAULT_PATHFINDER_URL } from "../../clients/createMeeClient" import { testnetMcUSDC } from "../../constants" import { type GasTankAccount, toGasTankAccount } from "../toGasTankAccount" -// @ts-ignore const { runPaidTests } = inject("settings") describe("mee.getGasTankBalance", () => { diff --git a/src/sdk/account/decorators/instructions/buildComposable.test.ts b/src/sdk/account/decorators/instructions/buildComposable.test.ts index d594dfc0..476825e5 100644 --- a/src/sdk/account/decorators/instructions/buildComposable.test.ts +++ b/src/sdk/account/decorators/instructions/buildComposable.test.ts @@ -44,7 +44,6 @@ import { import { getMeeScanLink, getMultichainContract } from "../../utils" import buildComposable from "./buildComposable" -// @ts-ignore const { runPaidTests } = inject("settings") describe.runIf(runPaidTests)("mee.buildComposable", () => { diff --git a/src/sdk/account/decorators/withdrawFromGasTank.test.ts b/src/sdk/account/decorators/withdrawFromGasTank.test.ts index 557af0be..e9a7bbec 100644 --- a/src/sdk/account/decorators/withdrawFromGasTank.test.ts +++ b/src/sdk/account/decorators/withdrawFromGasTank.test.ts @@ -17,7 +17,6 @@ import { testnetMcUSDC } from "../../constants" import { runtimeERC20BalanceOf } from "../../modules" import { type GasTankAccount, toGasTankAccount } from "../toGasTankAccount" -// @ts-ignore const { runPaidTests } = inject("settings") describe("mee.withdrawFromGasTank", () => { diff --git a/src/sdk/clients/createBundlerClient.test.ts b/src/sdk/clients/createBundlerClient.test.ts index 01766470..d11fd71e 100644 --- a/src/sdk/clients/createBundlerClient.test.ts +++ b/src/sdk/clients/createBundlerClient.test.ts @@ -29,7 +29,6 @@ import { type MeeClient, createMeeClient } from "./createMeeClient" import { erc7579Actions } from "./decorators/erc7579" import { smartAccountActions } from "./decorators/smartAccount" -// @ts-ignore const { runPaidTests } = inject("settings") const COMPETITORS = [ diff --git a/src/sdk/clients/createMeeClient.test.ts b/src/sdk/clients/createMeeClient.test.ts index 365d5410..f7cd05f2 100644 --- a/src/sdk/clients/createMeeClient.test.ts +++ b/src/sdk/clients/createMeeClient.test.ts @@ -33,7 +33,6 @@ import { mcAUSDC, mcUSDC, testnetMcUSDC } from "../constants/tokens" import { type MeeClient, createMeeClient } from "./createMeeClient" import type { FeeTokenInfo } from "./decorators/mee/getQuote" -// @ts-ignore const { runPaidTests } = inject("settings") describe("mee.createMeeClient", async () => { diff --git a/src/sdk/clients/decorators/mee/executeFusionQuote.test.ts b/src/sdk/clients/decorators/mee/executeFusionQuote.test.ts index bf85662f..466a421d 100644 --- a/src/sdk/clients/decorators/mee/executeFusionQuote.test.ts +++ b/src/sdk/clients/decorators/mee/executeFusionQuote.test.ts @@ -24,7 +24,6 @@ import getFusionQuote from "./getFusionQuote" import type { FeeTokenInfo } from "./getQuote" import waitForSupertransactionReceipt from "./waitForSupertransactionReceipt" -// @ts-ignore const { runPaidTests } = inject("settings") describe.runIf(runPaidTests)("mee.executeFusionQuote", () => { diff --git a/src/sdk/clients/decorators/mee/getMmDtkQuote.test.ts b/src/sdk/clients/decorators/mee/getMmDtkQuote.test.ts index 223f20d8..39752083 100644 --- a/src/sdk/clients/decorators/mee/getMmDtkQuote.test.ts +++ b/src/sdk/clients/decorators/mee/getMmDtkQuote.test.ts @@ -51,7 +51,6 @@ import { import getMmDtkQuote from "./getMmDtkQuote" import { signMMDtkQuote } from "./signMmDtkQuote" -// @ts-ignore const { runPaidTests } = inject("settings") describe("mee.getMmDtkQuote", () => { diff --git a/src/sdk/clients/decorators/mee/signOnChainQuote.test.ts b/src/sdk/clients/decorators/mee/signOnChainQuote.test.ts index 515fe6b5..8ffe99f4 100644 --- a/src/sdk/clients/decorators/mee/signOnChainQuote.test.ts +++ b/src/sdk/clients/decorators/mee/signOnChainQuote.test.ts @@ -47,7 +47,6 @@ import { ON_CHAIN_PREFIX, signOnChainQuote } from "./signOnChainQuote" import type { Trigger } from "./signPermitQuote" import waitForSupertransactionReceipt from "./waitForSupertransactionReceipt" -// @ts-ignore const { runPaidTests } = inject("settings") describe.runIf(runPaidTests)("mee.signOnChainQuote", () => { diff --git a/src/sdk/clients/decorators/mee/signPermitQuote.test.ts b/src/sdk/clients/decorators/mee/signPermitQuote.test.ts index 5eae98e9..f6a23a64 100644 --- a/src/sdk/clients/decorators/mee/signPermitQuote.test.ts +++ b/src/sdk/clients/decorators/mee/signPermitQuote.test.ts @@ -38,7 +38,6 @@ import { type FeeTokenInfo, getQuote } from "./getQuote" import { type Trigger, signPermitQuote } from "./signPermitQuote" import waitForSupertransactionReceipt from "./waitForSupertransactionReceipt" -// @ts-ignore const { runPaidTests } = inject("settings") describe("mee.signPermitQuote", () => { let network: NetworkConfig diff --git a/src/sdk/modules/validators/smartSessions/toMultichainSmartSessions.test.ts b/src/sdk/modules/validators/smartSessions/toMultichainSmartSessions.test.ts index ef4ad7d0..ab0da130 100644 --- a/src/sdk/modules/validators/smartSessions/toMultichainSmartSessions.test.ts +++ b/src/sdk/modules/validators/smartSessions/toMultichainSmartSessions.test.ts @@ -33,7 +33,6 @@ import type { Validator } from "../toValidator" import { meeSessionActions } from "./decorators/mee" import { toSmartSessionsModule } from "./toSmartSessionsModule" -// @ts-ignore const { runPaidTests } = inject("settings") const COUNTER_ON_OPTIMISM = "0x167a039E79E4E90550333c7D97a12ebf5f6f116A" const COUNTER_ON_BASE = "0x3D9aEd944CC8cD91a89aa318efd6CDCD870241e8" diff --git a/src/test/globalSetup.ts b/src/test/globalSetup.ts index adfc048c..18958fd8 100644 --- a/src/test/globalSetup.ts +++ b/src/test/globalSetup.ts @@ -9,9 +9,3 @@ export const setup = async ({ provide }) => { } export const teardown = async () => {} - -declare module "vitest" { - export interface ProvidedContext { - settings: { runPaidTests: boolean } - } -} diff --git a/src/test/vitest.shims.d.ts b/src/test/vitest.shims.d.ts new file mode 100644 index 00000000..a85ebfe9 --- /dev/null +++ b/src/test/vitest.shims.d.ts @@ -0,0 +1,10 @@ +declare module "vitest" { + export interface ProvidedContext { + settings: { + runPaidTests: boolean + } + } +} + +// mark this file as a module so augmentation works correctly +export {} From 52c937f287c367790e92c352d12b1a968e47f6f6 Mon Sep 17 00:00:00 2001 From: Alexandru Cambose Date: Tue, 15 Jul 2025 11:53:48 +0400 Subject: [PATCH 2/2] fix: test type --- src/test/vitest.d.ts | 12 ++++++++++++ src/test/vitest.shims.d.ts | 10 ---------- tsconfig/tsconfig.types.json | 11 +++++++---- 3 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 src/test/vitest.d.ts delete mode 100644 src/test/vitest.shims.d.ts diff --git a/src/test/vitest.d.ts b/src/test/vitest.d.ts new file mode 100644 index 00000000..5d8eea6e --- /dev/null +++ b/src/test/vitest.d.ts @@ -0,0 +1,12 @@ +// vitest.d.ts +import "vitest" + +declare module "vitest" { + interface ProvidedContext { + settings: { + runPaidTests: boolean + } + } +} + +export {} diff --git a/src/test/vitest.shims.d.ts b/src/test/vitest.shims.d.ts deleted file mode 100644 index a85ebfe9..00000000 --- a/src/test/vitest.shims.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare module "vitest" { - export interface ProvidedContext { - settings: { - runPaidTests: boolean - } - } -} - -// mark this file as a module so augmentation works correctly -export {} diff --git a/tsconfig/tsconfig.types.json b/tsconfig/tsconfig.types.json index 6ee2578c..d460d41d 100644 --- a/tsconfig/tsconfig.types.json +++ b/tsconfig/tsconfig.types.json @@ -8,11 +8,14 @@ "declaration": true, "declarationMap": true, "noEmit": false, - "rootDir": "../src/sdk" + "rootDir": "../src/sdk", + "types": ["vitest"], + "typeRoots": ["./node_modules/@types", "./types"] }, "exclude": [ "../src/test/**/*.*", "../src/sdk/**/*.test.*", - "../src/sdk/**/*.spec.*", - ] -} \ No newline at end of file + "../src/sdk/**/*.spec.*" + ], + "include": ["src/**/*", "vitest.d.ts"] +}