Skip to content

Remove explicit 'any' type assertions in test helpers#84

Draft
Lang-Qiu wants to merge 1 commit into
NeoLabHQ:masterfrom
Lang-Qiu:auto-pr/type_annotations-1780789327
Draft

Remove explicit 'any' type assertions in test helpers#84
Lang-Qiu wants to merge 1 commit into
NeoLabHQ:masterfrom
Lang-Qiu:auto-pr/type_annotations-1780789327

Conversation

@Lang-Qiu

@Lang-Qiu Lang-Qiu commented Jun 6, 2026

Copy link
Copy Markdown

Background

The test file onStopHandler.test.ts contained explicit as any type assertions for payload objects in helper functions like createUserPromptSession and createStopSession. This practice bypasses TypeScript's type checking, which can mask potential type errors, reduce code reliability, and deviate from TypeScript best practices for type safety.

Changes

  • Removed as any assertions from the payload objects in createUserPromptSession and createStopSession test helper functions.
  • Ensured proper type annotations are applied to align with the expected StopPayload and SessionData types, improving type safety without altering runtime behavior.

Verification

Run the existing test suite (e.g., using npm test or equivalent) to confirm all tests pass, as these changes only affect type annotations and do not modify functionality. Additionally, verify that TypeScript compilation succeeds with strict type checking enabled.

@LeoVS09

LeoVS09 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Hi @Lang-Qiu, is this PR in development?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants