sinonjs / sinon

Test spies, stubs and mocks for JavaScript.

Home Page:https://sinonjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Throw meaningful error message when trying to return non-objects from stub used as constructor

fatso83 opened this issue · comments

Is your feature request related to a problem? Please describe.
See #1676. User's think that not returning a string or other non-object is an error when newing up objects. We should rather explicitly throw an error message saying this is intended.

Describe the solution you'd like
Throw an error