-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support external variables in tests? #37
Comments
Thanks for the kind words! And thanks for trying out autodoc; as I'm sure you're aware, it is really early at this point and so you may find yourself encountering bugs and weird behavior. As for this issue, the answer to the general question is: You're not missing anything; external variables is just a tricky thing I haven't 100% figured out how to deal with yet (though I have some ideas). I.e., I don't have a great mechanism in place for providing access within a That said, for this specific case, what you're trying to access can be marked as a global from autodoc's perspective and it should work. I.e., when running your tests use the
The Note that this only works as of 0.5.2, which I just published. (In 0.5.2 the |
Awesome, thanks :-) Just tried the Here is my command with the error: autodoc --test --globals _:lodash helpers/*.js I fixed it by setting NODE_PATH: NODE_PATH=$PWD/node_modules autodoc --test --globals _:lodash helpers/*.js Not sure how you can set NODE_PATH programatically or I would open a PR. |
Yeah you're right, I think I kinda botched that. I guess for now it will only work with packages you've installed globally w/ |
I love autodoc, I love the inline testing and doc generating, and I love how it encourages me to write simple tiny testable functions :-)
One question I have is: is there a way to allow external variables in a test?
Eg one of my functions uses
_.filter
, and I can't figure out how to make autodoc's testing find/have_
.Am I missing something or is this just not a feature yet?
The text was updated successfully, but these errors were encountered: