diff --git a/README.md b/README.md index ff87e2f..938825a 100644 --- a/README.md +++ b/README.md @@ -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'); +}); +``` diff --git a/package.json b/package.json index eaa52d4..ea3c660 100644 --- a/package.json +++ b/package.json @@ -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",