jsdoc-tests
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

jsdoc-tests

Node CI npm version

A JSDoc test tool for documentation-driven quality, support async function and export module(ES module/CommonJS).

Installation

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

Usage

  • Create A source code in ./src/example.ts with JSDoc.
/**
 * 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.
import { jsdocTests } from 'jsdoc-tests';

test('test "add" function', () => {
  jsdocTests('./src/example.ts');
});

Dependencies (2)

Dev Dependencies (14)

Package Sidebar

Install

npm i jsdoc-tests

Weekly Downloads

111

Version

1.1.1

License

MIT

Unpacked Size

19.9 kB

Total Files

25

Last publish

Collaborators

  • unadlib