jackbsteinberg / get-originals-rewriter

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

TypeScript behind on Object prototype properties #79

Open jackbsteinberg opened 5 years ago

jackbsteinberg commented 5 years ago

Some Object prototype properties are overridden by the classes that inherit from the Object prototype, and TypeScript has not reflected all of these overridden properties in their respective types. Specifically:

URL.toString()
Boolean.toString()
Error.toString()

are all missing toString in their properties. We commented on this bug on TypeScript to call attention to the absence, and will be tracking the issue. For now testing of Object prototype properties will be done with the assumption that the above are not overridden - with documentation outlining the situation, and code that will start to fail when TypeScript is updated.

fergald commented 5 years ago

Does our testing framework have any way to add tests we expect to fail? If so, we should add tests that exercise these missing features and once TS updates we can switch them away from expected-to-fail.

On Thu, 12 Sep 2019 at 16:39, Jack Steinberg notifications@github.com wrote:

Some Object prototype properties are overridden by the classes that inherit from the Object prototype, and TypeScript has not reflected all of these overridden properties in their respective types. Specifically:

URL.toString()Boolean.toString()Error.toString()

are all missing toString in their properties. We commented on this bug on TypeScript https://github.com/microsoft/TypeScript/issues/30225#issuecomment-530702739 to call attention to the absence, and will be tracking the issue. For now testing of Object prototype properties will be done with the assumption that the above are not overridden - with documentation outlining the situation, and code that will start to fail when TypeScript is updated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jackbsteinberg/get-originals-rewriter/issues/79?email_source=notifications&email_token=ABAO5ZZOL57B3YXMQF7KGZTQJHW4ZA5CNFSM4IWAKJE2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HK5CG4Q, or mute the thread https://github.com/notifications/unsubscribe-auth/ABAO5Z364SUQQHGHAKMJGSTQJHW4ZANCNFSM4IWAKJEQ .

domenic commented 5 years ago

It does not, sadly. That's a surprisingly-rare feature in the JavaScript testing ecosystem; I've searched around.

See https://github.com/facebook/jest/issues/8317