Skip to content

Use as unknown for unimportant as any cases in tests#274577

Merged
Tyriar merged 1 commit intomainfrom
tyriar/269213_unknown
Nov 2, 2025
Merged

Use as unknown for unimportant as any cases in tests#274577
Tyriar merged 1 commit intomainfrom
tyriar/269213_unknown

Conversation

@Tyriar
Copy link
Member

@Tyriar Tyriar commented Nov 2, 2025

Part of #269213

@Tyriar Tyriar added this to the October 2025 milestone Nov 2, 2025
@Tyriar Tyriar self-assigned this Nov 2, 2025
Copilot AI review requested due to automatic review settings November 2, 2025 09:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors type assertions in terminal test files to use safer TypeScript casting patterns. The changes replace the discouraged as any casts with as unknown as Type assertions, which provides better type safety by requiring an explicit intermediate cast. Additionally, the PR leverages the satisfies operator to ensure partial objects conform to expected types before casting, and removes now-unnecessary eslint-disable comments.

Key Changes

  • Replaces as any type assertions with as unknown as Type for improved type safety
  • Introduces satisfies Partial<Type> before casting to validate partial object shapes
  • Removes eslint-disable-next-line local/code-no-any-casts comments throughout test files

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
xtermTerminal.test.ts Adds constructor to TestWebglAddon, updates type casts for addon importer and view descriptor
shellIntegrationAddon.integrationTest.ts Converts event array casts and terminal config cast to use as unknown pattern, adds type import
terminalService.test.ts Updates all terminal instance partial objects to use satisfies with as unknown pattern, adds type import
terminalProfileService.integrationTest.ts Refactors backend/environment service mocks to use satisfies pattern, removes unused variable, updates config event casts
terminalProcessManager.test.ts Updates backend service mock to use async/proper typing, fixes config event cast, adds type imports
terminalInstance.test.ts Makes getBackend async, properly types createProcess parameters, adds type imports, fixes capability cast
terminalCapabilityStore.test.ts Converts all capability addition casts to typed as unknown pattern, adds capability type imports

@Tyriar Tyriar merged commit d8a36d1 into main Nov 2, 2025
33 of 34 checks passed
@Tyriar Tyriar deleted the tyriar/269213_unknown branch November 2, 2025 09:45
@Tyriar Tyriar marked this pull request as ready for review November 2, 2025 09:55
@Tyriar Tyriar enabled auto-merge November 2, 2025 09:55
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants