From b1260f2d17675f5b456e0056850bae3510596523 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Thu, 21 Dec 2017 14:30:08 -0800 Subject: [PATCH] lint docs/**/*.md [ci skip] --- docs/_includes/backers.md | 3 ++- docs/_includes/sponsors.md | 1 + docs/index.md | 41 +++++++++++++++++++------------------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/docs/_includes/backers.md b/docs/_includes/backers.md index ccf561abfa..93e133c2ff 100644 --- a/docs/_includes/backers.md +++ b/docs/_includes/backers.md @@ -1,6 +1,7 @@ ## Backers -Find Mocha helpful? Become a [backer](https://opencollective.com/mochajs#support) and support Mocha with a monthly donation. +Find Mocha helpful? Become a [backer](https://opencollective.com/mochajs#support) and support Mocha with a monthly donation. + {: id="_backers" } {% for i in (0..29) %}[![](//opencollective.com/mochajs/backer/{{ i }}/avatar){: onload="window.avatars.backerLoaded()" }](https://opencollective.com/mochajs/backer/{{ i }}/website){: target="_blank"} {% endfor %} diff --git a/docs/_includes/sponsors.md b/docs/_includes/sponsors.md index 5fe0c7d9c1..d6afa24f4d 100644 --- a/docs/_includes/sponsors.md +++ b/docs/_includes/sponsors.md @@ -2,5 +2,6 @@ Use Mocha at Work? Ask your manager or marketing team if they'd help [support](https://opencollective.com/mochajs#support) our project. Your company's logo will also be displayed on [npmjs.com](http://npmjs.com/package/mocha) and our [GitHub repository](https://github.com/mochajs/mocha#sponsors). + {: id="_sponsors" } {% for i in (0..29) %}[![](//opencollective.com/mochajs/sponsor/{{ i }}/avatar){: onload="window.avatars.sponsorLoaded()" }](https://opencollective.com/mochajs/sponsor/{{ i }}/website){: target="_blank"} {% endfor %} diff --git a/docs/index.md b/docs/index.md index 371a729c49..c2c1f84944 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,17 +23,17 @@ Mocha is a feature-rich JavaScript test framework running on [Node.js](http://no - [maps uncaught exceptions to the correct test case](#browser-specific-methods) - [async test timeout support](#delayed-root-suite) - [test retry support](#retry-tests) -- [test-specific timeouts](#test-level) +- [test-specific timeouts](#test-level) - [growl notification support](#mochaopts) - [reports test durations](#test-duration) - [highlights slow tests](#dot-matrix) -- [file watcher support](#min) -- [global variable leak detection](#--check-leaks) -- [optionally run tests that match a regexp](#-g---grep-pattern) +- [file watcher support](#min) +- [global variable leak detection](#--check-leaks) +- [optionally run tests that match a regexp](#-g---grep-pattern) - [auto-exit to prevent "hanging" with an active loop](#--exit----no-exit) - [easily meta-generate suites](#markdown) & [test-cases](#list) - [mocha.opts file support](#mochaopts) -- clickable suite titles to filter test execution +- clickable suite titles to filter test execution - [node debugger support](#-d---debug) - detects multiple calls to `done()` - [use any assertion library you want](#assertions) @@ -295,7 +295,7 @@ describe('hooks', function() { }); ``` -> Tests can appear before, after, or interspersed with your hooks. Hooks will run in the order they are defined, as appropriate; all `before()` hooks run (once), then any `beforeEach()` hooks, tests, any `afterEach()` hooks, and finally `after()` hooks (once). +> Tests can appear before, after, or interspersed with your hooks. Hooks will run in the order they are defined, as appropriate; all `before()` hooks run (once), then any `beforeEach()` hooks, tests, any `afterEach()` hooks, and finally `after()` hooks (once). ### Describing Hooks @@ -527,9 +527,9 @@ it('should only test in the correct environment', function() { }); ``` -The above test will be reported as [pending](#pending-tests). It's also important to note that calling `this.skip()` will effectively *abort* the test. +The above test will be reported as [pending](#pending-tests). It's also important to note that calling `this.skip()` will effectively *abort* the test. -> *Best practice*: To avoid confusion, do not execute further instructions in a test or hook after calling `this.skip()`. +> *Best practice*: To avoid confusion, do not execute further instructions in a test or hook after calling `this.skip()`. Contrast the above test with the following code: @@ -647,7 +647,6 @@ describe('something slow', function() { }); ``` - ## Timeouts ### Suite-level @@ -704,7 +703,7 @@ Mocha supports the `err.expected` and `err.actual` properties of any thrown `Ass ## Usage -``` +```text Usage: mocha [debug] [options] [files] @@ -778,7 +777,7 @@ Executes tests on changes to JavaScript in the CWD, and once initially. ### `--exit` / `--no-exit` -*Updated in Mocha v4.0.0* +> *Updated in Mocha v4.0.0* *Prior to* version v4.0.0, *by default*, Mocha would force its own process to exit once it was finished executing all tests. This behavior enables a set of potential problems; it's indicative of tests (or fixtures, harnesses, code under test, etc.) which don't clean up after themselves properly. Ultimately, "dirty" tests can (but not always) lead to *false positive* or *false negative* results. @@ -797,7 +796,7 @@ To ensure your tests aren't leaving messes around, here are some ideas to get st ### `--compilers` -*Updated in Mocha v4.0.0* +> *Updated in Mocha v4.0.0* **`--compilers` is deprecated as of Mocha v4.0.0. See [further explanation and workarounds](https://github.com/mochajs/mocha/wiki/compilers-deprecation).** @@ -1110,9 +1109,9 @@ The SuperAgent request library [test documentation](http://visionmedia.github.io ```makefile test-docs: - $(MAKE) test REPORTER=doc \ - | cat docs/head.html - docs/tail.html \ - > docs/test.html + $(MAKE) test REPORTER=doc \ + | cat docs/head.html - docs/tail.html \ + > docs/test.html ``` View the entire [Makefile](https://github.com/visionmedia/superagent/blob/master/Makefile) for reference. @@ -1210,7 +1209,7 @@ The following option(s) *only* function in a browser context: Back on the server, Mocha will attempt to load `./test/mocha.opts` as a configuration file of sorts. The lines in this file are combined with any command-line arguments. The command-line arguments take precedence. For example, suppose you have the following `mocha.opts` file: -``` +```sh --require should --reporter dot --ui bdd @@ -1253,6 +1252,7 @@ The plugin is titled **NodeJS**, and can be installed via **Preferences** > **Pl ![Wallaby.js in Action](images/wallaby.png) ### Emacs + [Emacs](https://www.gnu.org/software/emacs/) support for running Mocha tests is available via a 3rd party package [mocha.el](https://github.com/scottaj/mocha.el). The package is available on MELPA, and can be installed via `M-x package-install mocha`. ![Emacs Mocha Runner in Action](images/emacs.png) @@ -1263,10 +1263,10 @@ The plugin is titled **NodeJS**, and can be installed via **Preferences** > **Pl #### Features -* see all tests in VS Code sidebar menu -* run & debug tests for each level hierarchy from all tests to a single test (and each describe of course) -* auto run tests on file save -* see tests results directly in the code editor +- see all tests in VS Code sidebar menu +- run & debug tests for each level hierarchy from all tests to a single test (and each describe of course) +- auto run tests on file save +- see tests results directly in the code editor ![mocha side bar in Action](images/mocha_side_bar.png) @@ -1299,4 +1299,3 @@ $ REPORTER=nyan npm test ## More Information In addition to chatting with us on [Gitter](https://gitter.im/mochajs/mocha), for additional information such as using spies, mocking, and shared behaviours be sure to check out the [Mocha Wiki](https://github.com/mochajs/mocha/wiki) on GitHub. For discussions join the [Google Group](http://groups.google.com/group/mochajs). For a running example of Mocha, view [example/tests.html](example/tests.html). For the JavaScript API, view the [source](https://github.com/mochajs/mocha/blob/master/lib/mocha.js#L51). -