Skip to content

jimCresswell/api-test-supertest-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Releases

No releases published

Packages

No packages published