Skip to content

CI check failing on main: TS2742 in telegram/bot.media.test-utils.ts #26011

@mr-sk

Description

@mr-sk

Bug

The check CI job is failing on all PRs due to a TypeScript error on main:

src/telegram/bot.media.test-utils.ts(5,14): error TS2742: The inferred type of 'cacheStickerSpy' cannot be named without a reference to '.pnpm/@[email protected]/node_modules/@vitest/spy'. This is likely not portable. A type annotation is necessary.
src/telegram/bot.media.test-utils.ts(6,14): error TS2742: The inferred type of 'getCachedStickerSpy' cannot be named without a reference to '.pnpm/@[email protected]/node_modules/@vitest/spy'. This is likely not portable. A type annotation is necessary.
src/telegram/bot.media.test-utils.ts(7,14): error TS2742: The inferred type of 'describeStickerImageSpy' cannot be named without a reference to '.pnpm/@[email protected]/node_modules/@vitest/spy'. This is likely not portable. A type annotation is necessary.

This blocks the check gate, which prevents build-artifacts, checks, and checks-windows from running.

Fix

Add explicit type annotations to the exported spy variables in src/telegram/bot.media.test-utils.ts, e.g.:

import type { Mock } from "vitest";
export const cacheStickerSpy: Mock = vi.fn();

Related

Similar to #16512 and #17315 (both closed, different files).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions