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
- Host: GitHub
- URL: https://github.com/devorein/exgen
- Owner: Devorein
- License: mit
- Created: 2022-01-15T05:47:25.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-06T05:16:38.000Z (over 4 years ago)
- Last Synced: 2024-04-27T07:07:32.261Z (about 2 years ago)
- Topics: doc-gen, markdown, remark, typedoc, typescript, unit-test
- Language: TypeScript
- Homepage:
- Size: 252 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
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