Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Nov 27, 2024

  • 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.

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.
@dgozman dgozman force-pushed the ts-update-test-extend-types branch from b27eeb0 to c1447eb Compare November 28, 2024 09:17
Copy link
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 dgozman requested a review from pavelfeldman November 29, 2024 15:50
@dgozman dgozman merged commit 0937d2f into microsoft:main Dec 9, 2024
29 checks passed
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