Skip to content

fix(utils): MaybeMockedConstructor returns T#1976

Merged
ahnpnl merged 1 commit intokulshekhar:masterfrom
KostyaTretyak:master
Sep 21, 2020
Merged

fix(utils): MaybeMockedConstructor returns T#1976
ahnpnl merged 1 commit intokulshekhar:masterfrom
KostyaTretyak:master

Conversation

@KostyaTretyak
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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