-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
createStubInstance fails with property getters that have deep chains #1036
Milestone
Comments
#1059 will likely fix this issue. Sorry to keep you waiting. |
@fatso83 Wheren't you planing to cut another |
If I did, I forgot 😳. Will do tonight.
|
@fatso83 no worries! You guys are doing an awesome job! |
#1059 was merged into master and sinon@2.0.0-pre.2 was published to NPM. I'm going to resolve this issue, please re-open if you feel there's more work to be done here, please :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What did you expect to happen?
That a Stub of Cesium's Viewer would be produced and I could work with it.
What actually happens
TypeError: Cannot read property 'defaultDataSource' of undefined
sinon/lib/sinon/util/core/walk.js:23:0
sinon/lib/sinon/util/core/walk.js:18:0
sinon/lib/sinon/util/core/walk.js:29:0
sinon/lib/sinon/util/core/walk.js:44:0
sinon/lib/sinon/stub.js:59:0
sinon/lib/sinon/stub.js:81:0
createStubInstance crashes while walking. It gets to the 'entities' property of Cesium's Viewer and crashes with the error:
It seems to be because the property is defined as:
entities : { get : function() { return this._dataSourceDisplay.defaultDataSource.entities; } }
and this._dataSourceDisplay is undefined.
I think it's because a property is doing a little more than it should, but these things are likely to happen in some people's code and it's a 3rd party library rather than my own code.
How to reproduce
I've had a go at this. It's not the same version of sinon but I wasn't sure how to get it working. With this version there seems to be no problem. If you let me know how to use the latest sinon like this then I will try it again.
http://jsbin.com/nipukikiqi/edit?html,js,console
See this for an example
The text was updated successfully, but these errors were encountered: