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

TypeScript behind on Object prototype properties #79

Open
jackbsteinberg opened this issue Sep 12, 2019 · 2 comments
Open

TypeScript behind on Object prototype properties #79

jackbsteinberg opened this issue Sep 12, 2019 · 2 comments

Comments

@jackbsteinberg
Copy link
Owner

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
Copy link
Collaborator

fergald commented Sep 12, 2019 via email

@domenic
Copy link
Collaborator

domenic commented Sep 12, 2019

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

See jestjs/jest#8317

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

No branches or pull requests

3 participants