@webex/jsdoctrinetest
Version:
52 lines (35 loc) • 1.17 kB
Markdown
# @webex/jsdoctrinetest
[](https://github.com/RichardLitt/standard-readme)
> Mocha plugin which parses source code for doc blocks containing assertions and runs them as mocha specs.
- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)
- [Maintainers](#maintainers)
- [License](#license)
## Install
```bash
npm install --save @webex/jsdoctrinetest
```
## Usage
Assuming your source code is in `./src` and you've got code like
```js
/**
* @example
* fn();
* //=> true
* @returns {boolean}
*/
exports.fn = function fn() {
return true;
};
```
The following command will create a run a mocha spec asserting the result of `fn()` is `true`.
```bash
mocha -r @webex/jsdoctrinetest ./src
```
## Maintainers
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
## Contribute
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
## License
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.