diff --git a/.eslintignore b/.eslintignore index a7a33c25c6..bf70c4ebbe 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,6 +2,7 @@ coverage/ mocha.js *.fixture.js docs/_site +docs/api docs/_dist docs/example out/ diff --git a/.wallaby.js b/.wallaby.js index b23a244650..59083bb5f4 100644 --- a/.wallaby.js +++ b/.wallaby.js @@ -48,6 +48,7 @@ module.exports = () => { ); require('./test/setup'); }, - debug: true + debug: true, + runMode: 'onsave' }; }; diff --git a/docs/index.md b/docs/index.md index b8396ea39e..ebe5f86ed1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -78,9 +78,9 @@ In your editor: ```js var assert = require('assert'); -describe('Array', function () { - describe('#indexOf()', function () { - it('should return -1 when the value is not present', function () { +describe('Array', function() { + describe('#indexOf()', function() { + it('should return -1 when the value is not present', function() { assert.equal([1, 2, 3].indexOf(4), -1); }); }); @@ -116,51 +116,65 @@ $ npm test ## Run Cycle Overview -A brief outline on the order Mocha's components are executed. -Worth noting that all hooks, `describe` and `it` callbacks are run in the order they are defined (i.e. found in the file). - -``` -run 'mocha spec.js' -| -spawn child process -| -|--------------> inside child process - process and apply options - | - run spec file/s - | - |--------------> per spec file - suite callbacks (e.g., 'describe') - | - 'before' root-level pre-hook - | - 'before' pre-hook - | - |--------------> per test - 'beforeEach' root-level pre-hook - | - 'beforeEach' pre-hook - | - test callbacks (e.g., 'it') - | - 'afterEach' post-hook - | - 'afterEach' root-level post-hook - |<-------------- per test end - | - 'after' post-hook - | - 'after' root-level post-hooks - |<-------------- per spec file end -|<-------------- inside child process end -``` +> Updated for v9.0.0. + +The following is a mid-level outline of Mocha's "flow of execution" when run in Node.js; the "less important" details have been omitted. + +In a browser, test files are loaded by `