-
Notifications
You must be signed in to change notification settings - Fork 141
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
td.callback, when given a td.object, raises a TypeError #124
Comments
(Forgive me for just reading the bottom of this issue but I think based on the conclusion I know what you're asking. We'll reopen if I'm wrong) The API If what you want, as your example indicates, is a bag of functions, then you should pass them as an array of strings. In your case: td.object(['json']); This will give you a plain old javascript object that has |
OK, that fixed it. Thanks for the fast response! How could I tell if my runtime supports an ES2015 Proxy? All of this is just ES5, so presumably that means it doesn't? And is that why I get this error, i.e. if I did have support for ES2015 Proxy objects, it would've worked as expected (even thought it was certainly not what I was intending :)? |
Proxy is a global so |
It appears defined for me. Also, the real test I extracted this example from has other uses of I also tried a few other things: var mockResponse = td.object("Response"); // but still calling JSON and var mockResponse = td.object("Response"); // but still calling JSON
mockResponse.json; // to see if this establishes the function in advance
mockResponse.json(); // also to see if this establishes the function in advance Those all had the same error result as before. |
And to be clear, I acknowledge that I'm using it wrong, but this behavior seems odd to me and many minutes of experience with this library :) |
Per discussion on twitter:
|
Figures. Paging @jasonkarns to commiserate |
@davetron5000 I think my next course of action is to add a node 7 specific tests since we never had firefox in CI i don't think |
This is on 1.6.0 of testdouble.js and 3.10.1 of lodash
Given this code:
I get this output:
If I replace
with
everything works.
I looked into the code, but can't understand what's going on enough to be more helpful :(
The text was updated successfully, but these errors were encountered: