☕️ Classic, reliable, trusted test framework for Node.js and the browser
fix: show --clear-screen in help command (#6360)
Mostafa Nazari8f286b5c3377
diff --git a/lib/cli/run-option-metadata.cjs b/lib/cli/run-option-metadata.cjsindex d3e252d5..b19fee0d 100644--- a/lib/cli/run-option-metadata.cjs+++ b/lib/cli/run-option-metadata.cjs@@ -101,6 +101,7 @@ const descriptions = {"Require all tests to use a callback (async) or return a Promise",bail: 'Abort ("bail") after first test failure',"check-leaks": "Check for global variable leaks",+ "clear-screen": "Clear the terminal before each run in watch mode",color: "Force-enable color output",config: "Path to config file",delay: "Delay initial execution of root suite",diff --git a/test/node-unit/cli/mocha-flags.spec.cjs b/test/node-unit/cli/mocha-flags.spec.cjsindex dbfa7482..8c9ca320 100644--- a/test/node-unit/cli/mocha-flags.spec.cjs+++ b/test/node-unit/cli/mocha-flags.spec.cjs@@ -4,6 +4,7 @@ var { expect } = require("chai");const {types,expectedTypeForFlag,+ getRunOptionDefinitions,} = require("../../../lib/cli/run-option-metadata.cjs");describe("mocha-flags", function () {@@ -25,4 +26,14 @@ describe("mocha-flags", function () {expect(expectedTypeForFlag("--foo")).to.equal(undefined);});});++ describe("getRunOptionDefinitions()", function () {+ getRunOptionDefinitions()+ .filter((option) => option.name !== "spec")+ .forEach((option) => {+ it(`gives ${option.name} a description`, function () {+ expect(option.description).to.be.a("string").that.is.not.empty;+ });+ });+ });});