-
Notifications
You must be signed in to change notification settings - Fork 58
Does this project only work with APIs built in Node.js? #133
Comments
Hey @baynezy, to be honest, I didn't know there were questions on SO regarding this project! I'll have to keep an eye out for those, thank you. Simple answer: No, it is not exclusively for Node.js APIs. Longer answer: The API doesn't have to be implemented in Node.js for a STT generated test to target it with an HTTP request. You have to use Node.js to utilize this module (obviously), but as long as you point the tests at a running server (localhost:1337, my.api.test.net) the implementation doesn't matter. The caveat here is that this module was designed to run with mocha which is a Node.js test runner/framework. So the tests have to be in a Node.js project, but the server implementation doesn't. Does that clear things up? Thanks for the question. |
@noahdietz - thanks that does clear things up. Thank you very much. I am fine with the testing application mandating Node.js. It is just that I want to test an API written in Java. I do have one other question though. I might be being slow, but how do you point it at a particular host? None of the arguments seem to suggest that they do that. |
I followed up on the SO question as well, thank you for bringing that to my attention. The host is derived from your Swagger's global I realize that it isn't convenient to change this value whenever you want to test something, and an option to override this would be helpful. |
@noahdietz - thanks. I also followed up on that SO post 😉 👍 So based on what you are saying if I am using swagger-test-templates as an NPM module then I need to make sure that my API I am testing is running on http://localhost:10010 ? |
Not quite. The default, if your Swagger spec does not contain a And just so I know we are on the same page, this module does not administer tests when it is run. STT only generates scaffolding test code for your API based on the Swagger, that then need to be written to file. (Not trying to be condescending, just want to make sure we are having the same conversation. The SO issue seemed to want a solution for administering tests. This is not that.) Does that make more sense? Thanks for the patience. |
@noahdietz - totally understand on the On the other issue. What I want is something that will generate me some tests from a Swagger spec. So that I can get some coverage for free (or cheap) of the plumbing of HTTP of a REST API. So that I can concentrate on testing business logic. So I think we are on the same page. |
For the
|
@baynezy perfect, you are a prime user then 😄 That work around is definitely manageable. Good idea. If I get a free cycle or two, I might add a If you don't have anymore questions, feel free to close the issue. You can also hit me up/DM me on Twitter @no_d_here if you don't want to open an issue to ask a question. Thanks for using this and asking questions! Love to see this in use |
Thanks for all your help @noahdietz |
I wouldn't normally bug you with questions via GitHub issues, but I am struggling to find an answer to this question. I have searched high and low for an answer and have not managed to find a definitive conclusion.
This poor fellow asked about a year ago and suffered the fact that people didn't read his question. So I thought I would ask here as I didn't want to be another statistic on StackOverflow.
Thanks.
The text was updated successfully, but these errors were encountered: