swagger-test-templates | Test code generated from Swagger | REST library
kandi X-RAY | swagger-test-templates Summary
kandi X-RAY | swagger-test-templates Summary
Generate test code from a Swagger spec(version 2.0).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get data from a Swagger operation
- Main function
- Run the Swagger .
- Generate a path to test remote path
- Generates a test response
- Browserify path helpers
- Generate content types .
- Stringifies an object
- Pretty prints data .
- Returns length .
swagger-test-templates Key Features
swagger-test-templates Examples and Code Snippets
Community Discussions
Trending Discussions on swagger-test-templates
QUESTION
Hi everyone,
My list of API resources/endpoints has really grown over the months and I have foolishly neglected writing integration tests for most of these APIs. The list of APIs continues to grow and consequently, I have a strong need for integration test code generation.
Luckily, all of my APIs are described in a v2.0 swagger.json spec, and I've found a few frameworks/modules for generating test code:
https://www.npmjs.com/package/swagger-test
https://github.com/apigee-127/swagger-test-templates
https://github.com/apigee-127/swagger-testing
My question to the community is, which framework/module for api integration test code generation have you found to be the overall best? Two important notes in my case:
- Integration test code generated must be written in node.js
- I have lots of different APIs which require different JSON request data, and I would need to generate/mock and insert said JSON data into the outgoing test HTTP messages.
- The tests need to send HTTP messages to an external host running the API application (i.e. NOT localhost).
Thanks in advance for any and all help/insight!
Best,
Chris
UPDATE: After some research and trial/error, I've found that https://github.com/apigee-127/swagger-test-templates is the most robust and full-featured option. If anyone has any opinions on this module, please share!
...ANSWER
Answered 2019-Jan-11 at 07:34I decided to go with the oatts module:
https://github.com/google/oatts
https://google.github.io/oatts/
This seemed to be a much more evolved version of the swagger-test-templates module, and it was self advertised as such :)
I was able to successfully generate quite a bit of quality test code using the oatts module.
Best,
Chris
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install swagger-test-templates
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page