microsoft / tslib

Runtime library for TypeScript helpers.
BSD Zero Clause License
1.24k stars 124 forks source link

Add 'configurable: true' to descriptors in __createBinding and __setModuleDefault #247

Closed rbuckton closed 3 months ago

rbuckton commented 4 months ago

This is the companion PR to microsoft/TypeScript#57784 which improves compatibility with Jest's module mocking mechanism.

rbuckton commented 3 months ago

Following discussion in the Design Meeting, we've decided not to take this fix as we would be inconsistent with esbuild, babel, et al. There are already workarounds for this, such as using jest.unstable_moduleMock, and this seems like an issue Jest would need to address in their mock implementation so as to be compatible with other transpilers, such as replacing the module object, introducing a Proxy, etc.