Skip to content

Conversation

jason-ha
Copy link
Contributor

Use AbsentProperty token to mark absent properties under Proxy rather than undefined to support exactOptionalPropertyTypes=true builds. Additionally add has checks within failSometimeProxy to detect new properties whose existence is checked that way.

Remove unused undefined unions in MockContainer that violate IContainer specification under exactOptionalPropertyTypes=true.

Use `AbsentProperty` token to mark absent properties under Proxy rather than `undefined` to support exactOptionalPropertyTypes=true builds.
Additionally add `has` checks within `failSometimeProxy` to detect new properties whose existence is checked that way.

Remove unused `undefined` unions in `MockContainer` that violate `IContainer` specification under exactOptionalPropertyTypes=true.
@github-actions github-actions bot added area: loader Loader related issues base: main PRs targeted against main branch labels Oct 10, 2025
Copy link
Contributor

@Copilot 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 updates the client-container-loader test suite to support TypeScript's exactOptionalPropertyTypes compiler option by introducing an AbsentProperty token to explicitly mark absent properties in test proxies instead of using undefined.

  • Enables exactOptionalPropertyTypes in the TypeScript configuration for improved type safety
  • Introduces AbsentProperty symbol and PartialOrAbsent type for explicit property absence handling
  • Updates test proxies to use AbsentProperty instead of undefined for optional properties

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/loader/container-loader/src/test/tsconfig.json Removes the exactOptionalPropertyTypes: false override to enable strict optional property type checking
packages/loader/container-loader/src/test/failProxy.ts Adds AbsentProperty symbol, PartialOrAbsent type, and implements has trap for proper property existence handling
packages/loader/container-loader/src/test/testProxies.ts Updates proxy creation to use AbsentProperty for optional properties
packages/loader/container-loader/src/test/loader.spec.ts Updates proxy initialization to use AbsentProperty
packages/loader/container-loader/src/test/container.spec.ts Removes unnecessary undefined unions from MockContainer properties
packages/loader/container-loader/src/test/attachment.spec.ts Updates proxy creation and property handling to use new AbsentProperty pattern

Handle AbsentProperty in createProxyWithFailDefault.
Use Reflect.get and only one read in failSometimeProxy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: loader Loader related issues base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant