Skip to content

fix(types): update types for test.extend - #33784

Merged
Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dgozman:ts-update-test-extend-types
Dec 9, 2024
Merged

Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dgozman:ts-update-test-extend-types

Conversation

@dgozman

@dgozman Dmitry Gozman (dgozman) commented Nov 27, 2024

Copy link
Copy Markdown
Collaborator
  • Replace KeyValue with {} to avoid inferring KeyValue when not intended and turning all properties into any.
  • Narrow down with Exclude<keyof K, keyof PW | keyof PT> to make sure overridden fixtures inherit from the base test type, and are not looked up in the extended fixtures list where they are not present.

This should fix errors with TypeScript 5.8.

Fixes #33763.
See microsoft/TypeScript#60619 and #33782 for more context.

@github-actions

This comment has been minimized.

- Replace `KeyValue` with `{}` to avoid inferring `KeyValue` when not intended
  and turning all properties into `any`.
- Employ `as Exclude<K, keyof PW | keyof PT>` technique to make sure
  overridden fixtures inherit from the base test type, and are not looked up
  in the extended fixtures list where they are not present.

This should fix errors with TypeScript 5.8.
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

2 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-aria.spec.ts:77:7 › should update aria snapshot highlight @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

37172 passed, 650 skipped
✔️✔️✔️

Merge workflow run.

@dgozman
Dmitry Gozman (dgozman) merged commit 0937d2f into microsoft:main Dec 9, 2024
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.

[Bug]: Types for fixtures are broken in TypeScript 5.7.2

2 participants