An open API service indexing awesome lists of open source software.

https://github.com/devorein/exgen

Generate examples of your api using unit tests
https://github.com/devorein/exgen

doc-gen markdown remark typedoc typescript unit-test

Last synced: about 2 months ago
JSON representation

Generate examples of your api using unit tests

Awesome Lists containing this project

README

          

# `exgen`

Easily generate examples for your api using existing unit tests.

**NOTE**: Packages of this monorepo are still under heavy development. Use with caution.

## Motivation

Writing examples of how to consume your api is crucial but its a difficult process. We need to make sure that the examples match the latest version of the api and at the same time it should be guaranteed that the examples are using tested code. If you have added unit tests for your api, then that itself can act as a source of documentation. Because when you write tests you are aware of the side-effects of the function, what the function returns or what it takes as arguments. Why not use that as part of your official documentation. By writing your tests in a certain way this library can automatically detect which functions need to be documented and how using your test assertions.

## Packages