Skip to content

Commit

Permalink
docs(readme): update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Nov 21, 2020
1 parent b9bf89f commit f261300
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,46 @@
# jsdoc-tests

![Node CI](https://github.com/unadlib/jsdoc-tests/workflows/Node%20CI/badge.svg)
[![npm version](https://badge.fury.io/js/jsdoc-tests.svg)](http://badge.fury.io/js/jsdoc-tests)

A JSDoc test tool for Documentation-Driven Quality

## Installation

```sh
yarn add -D jsdoc-tests # npm install -D jsdoc-tests
```

## Usage and Example

- Create A source code in `./src/example.ts` with JSDoc.

```ts
/**
* Two numbers added together
*
* @param a {number}
* @param b {number}
*
* @example
*
* ```ts
* const { add } = require('../test/example');
*
* expect(add(1, 2)).toBe(3);
* ```
*/
export const add = (a: number, b: number) => {
return a + b;
}
```

- Create a test file

```ts
import { jsdocTests } from 'jsdoc-tests';

test('test add', () => {
jsdocTests('./src/example.ts');
});
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsdoc-tests",
"version": "0.0.0",
"version": "0.0.1",
"description": "A JSDoc test tool for Documentation-Driven Quality",
"source": "src/index.ts",
"typings": "dist/index.d.ts",
Expand Down

0 comments on commit f261300

Please sign in to comment.