https://github.com/jskits/jsdoc-tests
A JSDoc test tool for documentation-driven quality
https://github.com/jskits/jsdoc-tests
documentation-driven-quality jest jsdoc-test testing testing-tool
Last synced: 7 months ago
JSON representation
A JSDoc test tool for documentation-driven quality
- Host: GitHub
- URL: https://github.com/jskits/jsdoc-tests
- Owner: jskits
- License: mit
- Created: 2020-11-21T18:47:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-17T03:46:58.000Z (over 1 year ago)
- Last Synced: 2025-07-22T22:48:23.022Z (7 months ago)
- Topics: documentation-driven-quality, jest, jsdoc-test, testing, testing-tool
- Language: TypeScript
- Homepage:
- Size: 227 KB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsdoc-tests

[](http://badge.fury.io/js/jsdoc-tests)
A JSDoc test tool for documentation-driven quality, support async function and export module(ES module/CommonJS).
## Installation
```sh
yarn add -D jsdoc-tests # npm install -D jsdoc-tests
```
## Usage
- Create A source code in `./src/example.ts` with JSDoc.
````ts
/**
* Two numbers added together
*
* @param a {number}
* @param b {number}
*
* @example
*
* ```ts
* import { add } from './src/example';
*
* expect(add(1, 2)).toBe(3);
* ```
*/
export const add = (a: number, b: number) => {
return a + b;
};
````
- Create a test code in `./test/index.test.ts`.
```ts
import { jsdocTests } from 'jsdoc-tests';
test('test "add" function', () => {
jsdocTests('./src/example.ts');
});
```
## License
`jsdoc-tests` is [MIT licensed](https://github.com/testkits/jsdoc-tests/blob/master/LICENSE).