Skip to content

Commit f31ce8f

Browse files
authored
Document #5412 (#5418)
1 parent 03ac2d0 commit f31ce8f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs-next/src/content/docs/running/configuring.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ In case of conflict, the priority is:
6262
Options which can safely be repeated (e.g., `--require`) will be _concatenated_, with higher-priority configuration sources appearing earlier in the list.
6363
For example, a `.mocharc.json` containing `"require": "bar"`, coupled with execution of `mocha --require foo`, would cause Mocha to require `foo`, then `bar`, in that order.
6464

65+
This also includes `spec`. For example, a `.mocharc.json` containing `"spec": ["**/*.test.js"]` coupled with execution of `mocha bar.spec.js` would be the same as runninng `mocha bar.spec.js **/*.test.js`, and it would still run all `.test.js` files. To workaround this, you can comment out the `spec` property or use a different config file via `--config`.
66+
6567
## Extending Configuration
6668

6769
Configurations can inherit from other modules using the `extends` keyword.

docs/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2291,7 +2291,9 @@ Mocha will also _merge_ any options found in `package.json` into its run-time co
22912291
1. Configuration file (`.mocharc.js`, `.mocharc.yml`, etc.)
22922292
1. `mocha` property of `package.json`
22932293

2294-
Options which can safely be repeated (e.g., `--require`) will be _concatenated_, with higher-priority configuration sources appearing earlier in the list. For example, a `.mocharc.json` containing `"require": "bar"`, coupled with execution of `mocha --require foo`, would cause Mocha to require `foo`, then `bar`, in that order.
2294+
Options which can safely be repeated (e.g., `--require`) will be _concatenated_, with higher-priority configuration sources appearing earlier in the list. For example, a `.mocharc.json` containing `"require": "bar"` coupled with execution of `mocha --require foo` would cause Mocha to require `foo`, then `bar`, in that order.
2295+
2296+
This also includes `spec`. For example, a `.mocharc.json` containing `"spec": ["**/*.test.js"]` coupled with execution of `mocha bar.spec.js` would be the same as runninng `mocha bar.spec.js **/*.test.js`, and it would still run all `.test.js` files. To workaround this, you can comment out the `spec` property or use a different config file via `--config`.
22952297

22962298
### Extending Configuration
22972299

0 commit comments

Comments
 (0)