UNPKG

1.17 kBMarkdownView Raw
1# mocha-standard
2
3**Integrates [standard] into your mocha tests.** This allows you to enforce a "one true" JavaScript coding style in your project via Mocha tests.
4
5This offers a finer alterantive to adding *standard* into package.json's `scripts.test` block.
6
7* Runs in the same node process as mocha, removing maybe 500ms of startup time.
8* Use `mocha --watch` to recheck for style failures. `standard` is used programatically, removing a huge overhead (around 1500ms) in re-running it repeatedly with `--watch`.
9* Painlessly integrate standard into your travisci.org tests.
10
11(Your speed gains may be a bit different from my Pentium II, of course.)
12
13![](https://raw.githubusercontent.com/rstacruz/mocha-standard/gh-pages/screenshot.png)
14
15[![Status](http://img.shields.io/travis/rstacruz/mocha-standard/master.svg)](https://travis-ci.org/rstacruz/mocha-standard/ "See test builds")
16
17<br>
18
19## Usage
20
21Add this test file to your Mocha suite:
22
23```js
24/* test/standard_test.js */
25it('conforms to standard', require('mocha-standard'))
26```
27
28<br>
29
30## Installation
31
32```sh
33npm install --save-dev mocha-standard standard
34```
35
36[standard]: https://www.npmjs.com/package/standard