Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jimcresswell/api-test-supertest-demo
Demo of Javascript API testing using Supertest
https://github.com/jimcresswell/api-test-supertest-demo
api-testing api-tests living-documentation mocha supertest
Last synced: about 14 hours ago
JSON representation
Demo of Javascript API testing using Supertest
- Host: GitHub
- URL: https://github.com/jimcresswell/api-test-supertest-demo
- Owner: jimCresswell
- Created: 2019-12-06T14:00:33.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T00:53:39.000Z (almost 2 years ago)
- Last Synced: 2024-04-15T01:51:56.689Z (7 months ago)
- Topics: api-testing, api-tests, living-documentation, mocha, supertest
- Language: JavaScript
- Homepage:
- Size: 310 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# api-test-supertest-demo
Demo of Javascript API testing using [Mocha](https://mochajs.org/) and [Supertest](https://github.com/visionmedia/supertest).## Usage
* `yarn test` or `npm test`.
* To generate a specification document from the tests `yarn document` or `npm run document`, the output is in the markdown file [specs.md](specs.md).## Notes
The tests are written in a [specification like format](test/example.spec.js), and the results can optionally be written out to a markdown file using `yarn document`, e.g. [specs.md](specs.md), this allows a [living documentation](https://gojko.net/books/specification-by-example/) approach where the tests/specs are used to generate validated system documentation that is *guaranteed* to be up to date.For a more data driven approach using the same tools the tests could be generated programmatically by iterating over collections of endpoints, REST verbs and expected results, [like this](https://mochajs.org/#dynamically-generating-tests).