From 61b6bb4261dd04ee37ae118aef13af93c86763ca Mon Sep 17 00:00:00 2001 From: Wanseob Lim Date: Sat, 16 Feb 2019 16:19:31 +0900 Subject: [PATCH] exclude auto-generated contents from docs/index.md; closes #3713 * Remove auto-generated contents from docs/index.md * Make documents from temporally copied file docs/index.md.tmp * Add docs/index.md.tmp to the .gitignore list --- .gitignore | 1 + docs/index.md | 118 +-------------------------------------------- package-lock.json | 75 +++++++++++++++++++++------- package-scripts.js | 5 +- package.json | 1 + 5 files changed, 63 insertions(+), 137 deletions(-) diff --git a/.gitignore b/.gitignore index 02634697bf..3c19244c58 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Mocha-specific docs/_site docs/_dist +docs/index.md.tmp mocha.js .karma/ !lib/mocha.js diff --git a/docs/index.md b/docs/index.md index f3d775f698..f9740b5c7f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -51,37 +51,6 @@ Mocha is a feature-rich JavaScript test framework running on [Node.js](https://n ## Table of Contents - -- [Installation](#installation) -- [Getting Started](#getting-started) -- [Run Cycle Overview](#run-cycle-overview) -- [Detects Multiple Calls to `done()`](#detects-multiple-calls-to-done) -- [Assertions](#assertions) -- [Asynchronous Code](#asynchronous-code) -- [Synchronous Code](#synchronous-code) -- [Arrow Functions](#arrow-functions) -- [Hooks](#hooks) -- [Pending Tests](#pending-tests) -- [Exclusive Tests](#exclusive-tests) -- [Inclusive Tests](#inclusive-tests) -- [Retry Tests](#retry-tests) -- [Dynamically Generating Tests](#dynamically-generating-tests) -- [Timeouts](#timeouts) -- [Diffs](#diffs) -- [Command-Line Usage](#command-line-usage) -- [Interfaces](#interfaces) -- [Reporters](#reporters) -- [Running Mocha in the Browser](#running-mocha-in-the-browser) -- [Desktop Notification Support](#desktop-notification-support) -- [Configuring Mocha (Node.js)](#configuring-mocha-nodejs) -- [`mocha.opts`](#mochaopts) -- [The `test/` Directory](#the-test-directory) -- [Error Codes](#error-codes) -- [Editor Plugins](#editor-plugins) -- [Examples](#examples) -- [Testing Mocha](#testing-mocha) -- [More Information](#more-information) - ## Installation @@ -814,88 +783,6 @@ Mocha supports the `err.expected` and `err.actual` properties of any thrown `Ass ## Command-Line Usage - -```plain - -mocha [spec..] - -Run tests with Mocha - -Commands - mocha debug [spec..] Run tests with Mocha [default] - mocha init create a client-side Mocha setup at - -Rules & Behavior - --allow-uncaught Allow uncaught errors to propagate [boolean] - --async-only, -A Require all tests to use a callback (async) or - return a Promise [boolean] - --bail, -b Abort ("bail") after first test failure [boolean] - --check-leaks Check for global variable leaks [boolean] - --delay Delay initial execution of root suite [boolean] - --exit Force Mocha to quit after tests complete [boolean] - --forbid-only Fail if exclusive test(s) encountered [boolean] - --forbid-pending Fail if pending test(s) encountered [boolean] - --global, --globals List of allowed global variables [array] - --retries Retry failed tests this many times [number] - --slow, -s Specify "slow" test threshold (in milliseconds) - [number] [default: 75] - --timeout, -t, --timeouts Specify test timeout threshold (in milliseconds) - [number] [default: 2000] - --ui, -u Specify user interface [string] [default: "bdd"] - -Reporting & Output - --color, -c, --colors Force-enable color output [boolean] - --diff Show diff on failure - [boolean] [default: true] - --full-trace Display full stack traces [boolean] - --growl, -G Enable Growl notifications [boolean] - --inline-diffs Display actual/expected differences - inline within each string [boolean] - --reporter, -R Specify reporter to use - [string] [default: "spec"] - --reporter-option, --reporter-options, Reporter-specific options - -O () [array] - -Configuration - --config Path to config file [default: (nearest rc file)] - --opts Path to `mocha.opts` [string] [default: "./test/mocha.opts"] - --package Path to package.json for config [string] - -File Handling - --exclude Ignore file(s) or glob pattern(s) - [array] [default: (none)] - --extension, --watch-extensions File extension(s) to load and/or watch - [array] [default: js] - --file Specify file(s) to be loaded prior to root - suite execution [array] [default: (none)] - --recursive Look for tests in subdirectories [boolean] - --require, -r Require module [array] [default: (none)] - --sort, -S Sort test files [boolean] - --watch, -w Watch files in the current working directory - for changes [boolean] - -Test Filters - --fgrep, -f Only run tests containing this string [string] - --grep, -g Only run tests matching this string or regexp [string] - --invert, -i Inverts --grep and --fgrep matches [boolean] - -Positional Arguments - spec One or more files, directories, or globs to test - [array] [default: ["test/"]] - -Other Options - --help, -h Show usage information & exit [boolean] - --version, -V Show version number & exit [boolean] - --interfaces List built-in user interfaces & exit [boolean] - --reporters List built-in reporters & exit [boolean] - -Mocha Resources - Chat: https://gitter.im/mochajs/mocha - GitHub: https://github.com/mochajs/mocha.git - Docs: https://mochajs.org/ - -``` - ### `--allow-uncaught` @@ -1823,8 +1710,5 @@ or the [source](https://github.com/mochajs/mocha/blob/master/lib/mocha.js). [mocha-website]: https://mochajs.org/ [mocha-wiki]: https://github.com/mochajs/mocha/wiki - - -[gitter]: https://gitter.im/mochajs/mocha - + diff --git a/package-lock.json b/package-lock.json index fe089799e8..ad3b4dca02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5423,6 +5423,12 @@ "is-symbol": "^1.0.2" } }, + "es6-object-assign": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", + "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", + "dev": true + }, "es6-promise": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", @@ -7476,15 +7482,13 @@ "version": "1.0.0", "resolved": false, "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "resolved": false, "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7501,22 +7505,19 @@ "version": "1.1.0", "resolved": false, "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "resolved": false, "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "resolved": false, "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -7640,15 +7641,13 @@ "version": "2.0.3", "resolved": false, "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true, - "optional": true + "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": false, "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -7665,7 +7664,6 @@ "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -7681,7 +7679,6 @@ "resolved": false, "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -7790,8 +7787,7 @@ "version": "1.0.1", "resolved": false, "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -7805,7 +7801,6 @@ "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -7943,7 +7938,6 @@ "resolved": false, "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -9819,6 +9813,12 @@ } } }, + "interpret": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", + "dev": true + }, "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", @@ -17778,6 +17778,15 @@ "integrity": "sha1-PtqOZfI80qF+YTAbHwADOWr17No=", "dev": true }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, "recursive-copy": { "version": "2.0.9", "resolved": "https://registry.npmjs.org/recursive-copy/-/recursive-copy-2.0.9.tgz", @@ -18738,6 +18747,36 @@ "jsonify": "~0.0.0" } }, + "shelljs": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", + "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "shx": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.2.tgz", + "integrity": "sha512-aS0mWtW3T2sHAenrSrip2XGv39O9dXIFUqxAEWHEOS1ePtGIBavdPJY1kE2IHl14V/4iCbUiNDPGdyYTtmhSoA==", + "dev": true, + "requires": { + "es6-object-assign": "^1.0.3", + "minimist": "^1.2.0", + "shelljs": "^0.8.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, "sift": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/sift/-/sift-6.0.0.tgz", diff --git a/package-scripts.js b/package-scripts.js index 30e4294be1..96179601ec 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -270,7 +270,8 @@ module.exports = { description: 'Build documentation' }, prebuild: { - script: 'rimraf docs/_dist docs/_site && nps docs.preprocess', + script: + 'shx cp docs/index.md docs/index.md.tmp && rimraf docs/_dist docs/_site && nps docs.preprocess', description: 'Prepare system for doc building', hiddenFromHelp: true }, @@ -283,7 +284,7 @@ module.exports = { preprocess: { default: { script: - 'md-magic --config ./scripts/markdown-magic.config.js --path docs/index.md', + 'md-magic --config ./scripts/markdown-magic.config.js --path docs/index.md.tmp', description: 'Preprocess documentation', hiddenFromHelp: true }, diff --git a/package.json b/package.json index 9c71d4f639..c6a2f6307e 100644 --- a/package.json +++ b/package.json @@ -554,6 +554,7 @@ "remark-inline-links": "^3.1.2", "rewiremock": "^3.12.3", "rimraf": "^2.5.2", + "shx": "^0.3.2", "sinon": "^7.1.1", "strip-ansi": "^5.0.0", "svgo": "^1.1.1",