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

expect: Test more precisely for class instance getters #7477

Merged
merged 5 commits into from
Dec 24, 2018

Conversation

pedrottimark
Copy link
Contributor

Summary

A new hasGetterFromConstructor helper function excludes unintended properties.

Test plan

Existing tests for intended use cases still pass.

Added 6 new unit tests to distinguish intended from unintended properties:

before after description
pass pass does inherit getter from class
fail pass does not inherit setter from class
fail pass does not inherit method from class
fail pass does not inherit property from constructor prototype
fail pass does not inherit __proto__ getter from Object
fail pass does not inherit toString method from Object

@SimenB SimenB merged commit 950997e into jestjs:master Dec 24, 2018
@pedrottimark pedrottimark deleted the class-instance-getters branch December 24, 2018 13:01
captain-yossarian pushed a commit to captain-yossarian/jest that referenced this pull request Jul 18, 2019
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants