Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 997 Bytes

README.md

File metadata and controls

11 lines (8 loc) · 997 Bytes

api-test-supertest-demo

Demo of Javascript API testing using Mocha and 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.

Notes

The tests are written in a specification like format, and the results can optionally be written out to a markdown file using yarn document, e.g. specs.md, this allows a living documentation 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.