-
-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sinon 1.17.0: sinon.createStubInstance cannot be used twice on the same constructor #852
Comments
I am unable to recreate this? Tried running it with everything from 1.16.1 to the latest
OK, didn't do a mistiake after all, I still cannot verify this ... |
Tried this in Node 0.12 and 4.1, as well as PhantomJS. Never a failing test. |
Sorry, left this here without further investigating. Had a hell of a day. I have a large test case that has this issue. Will see if I can extract the gist of it tomorrow. |
Creating a stub of a subclass reproduces the same error. describe('', function() {
var A = function() {};
var B = function() {};
B.prototype = Object.create(A.prototype);
B.prototype.constructor = B;
it('create stub instance of a subclass', function() {
var b = sinon.createStubInstance(B);
});
});
sinon 1.17.0 |
Cool, thanks for contributing, @flexfrank. Verified the bug in Node, so running |
This is a duplicate of #847, so closing this one. Do follow progress on the other. |
…ructors Fixes #852: Do not attempt to re-stub constructors
Sinon.JS v1.17.1 is now on npm, the website will be updated soon. |
I'm still getting this error on 1.17.1 node 0.12 |
@kmiyashiro that's surprising. Certainly not using the test case above? Do you have a consistent way of reproducing the bug so that it's possible to verify? |
Not using the test case and I do not have a reduced test case. I was using var BaseRouter = Backbone.Router.extend(...);
var Router = BaseRouter.extend(...);
sinon.createStubInstance(Router); |
This is a new issue in Sinon 1.17.0 and it's working fine with 1.16.1:
Fails on the second line with:
Environment: Node 4.0.0
The text was updated successfully, but these errors were encountered: