inversify / InversifyJS

A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.
http://inversify.io/
MIT License
11.02k stars 712 forks source link

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

Open brahms116 opened 2 months ago

brahms116 commented 2 months ago

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

Checklist: