InversifyJS icon indicating copy to clipboard operation
InversifyJS copied to clipboard

Fix injecting a property with .then results in undefined (#1570)

Open brahms116 opened this issue 1 year ago • 0 comments

Description

Used instance of Promise instead.

Struggled and unsure with the approached used to mock the promise stub in the modified test. Welcome for any feedback and ideas

Related Issue

https://github.com/inversify/InversifyJS/issues/1570

Motivation and Context

Its a bug which was found when used in conjunction with typemoq, their mock objects were returning undefined when rebinding to them.

How Has This Been Tested?

Added relevant test to demonstrate the bug

Types of changes

  • [ ] Updated docs / Refactor code / Added a tests case (non-breaking change)
  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [x] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [x] I have added tests to cover my changes.
  • [x] All new and existing tests passed.
  • [x] I have updated the changelog.

brahms116 avatar May 30 '24 05:05 brahms116