You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We understand you have a problem and are in a hurry, but please provide us with some info to make it much more likely for your issue to be understood, worked on and resolved quickly.
Sinon version : please verify that the bug exists in the latest Sinon release 4.4.2
Environment : Linux version 4.10.0-43-generic (buildd@lgw01-amd64-037) (gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)
Example URL :
Other libraries you are using:
What did you expect to happen?
var obj = {};
function Cls() {
return obj;
}
expect(new Cls()).equal(obj); // true
var ClassSpy = sinon.spy(Cls);
expect(new ClsSpy()).equal(obj); // false, expect true
What actually happens
It does not respect the rule that when a function returns an object, this object should become the instance of it when called with new as a constructor.
How to reproduce
Describe with code how to reproduce the faulty behaviour,
or link to code on JSBin or similar
Really long code sample or stacktrace
If you need to provide a dump of a stack trace or
other lengthy material, such as 80 lines of example code,
please stuff it in a `<details>` tag such as this
to make the issue more readable. Thanks.
The text was updated successfully, but these errors were encountered:
What did you expect to happen?
What actually happens
It does not respect the rule that when a function returns an object, this object should become the instance of it when called with
new
as a constructor.How to reproduce
Really long code sample or stacktrace
The text was updated successfully, but these errors were encountered: