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

fix(utils): MaybeMockedConstructor returns T #1976

Merged
merged 1 commit into from
Sep 21, 2020
Merged

fix(utils): MaybeMockedConstructor returns T #1976

merged 1 commit into from
Sep 21, 2020

Conversation

KostyaTretyak
Copy link
Contributor

@KostyaTretyak KostyaTretyak commented Sep 21, 2020

Summary

At this point, MaybeMockedConstructor can return an empty object, causing the source type to be lost. This PR fixes this.

For example, the mocked(MyClass.prototype) function actually returns a new type that has the same properties as MyClass.prototype, but does not link to MyClass.prototype.

Because of this, you cannot click on a specific property and go to the source class. For the same reason, during refactoring, renaming properties in the source class does not rename the corresponding properties in the tests.

Does this PR introduce a breaking change?

  • Yes
  • No

At this point, `MaybeMockedConstructor` can return an empty object, causing the source type to be lost. This PR fixes this.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 5961

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.214%

Totals Coverage Status
Change from base Build 5960: 0.0%
Covered Lines: 1137
Relevant Lines: 1171

💛 - Coveralls

Copy link
Collaborator

@ahnpnl ahnpnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks ! LGTM

@ahnpnl ahnpnl merged commit b7712b2 into kulshekhar:master Sep 21, 2020
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

Successfully merging this pull request may close these issues.

3 participants