-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add verification tests for Mocha's --extension option
- Loading branch information
Showing
9 changed files
with
1,890 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Tests to verify Mocha's `--extension` behaviour | ||
|
||
According to [Mocha's own docs](https://mochajs.org/#-extension-ext-watch-extensions-ext) one should be able to specify which extensions mocha will automatically load. | ||
|
||
> Specifying --extension will remove .js as a test file extension; use --extension js to re-add it. For example, to load .mjs and .js test files, you must supply --extension mjs --extension js. | ||
It quite clearly says that by specifying an extension, the default should be cleared. I have never seen this happen :-( | ||
|
||
## Output contradicting the docs | ||
|
||
The [`test`](./test) directory only contains a single file with the extension `bar`, so this means only one file should be loaded according to the docs. Instead, four files are loaded: | ||
``` | ||
mocha --extension bar | ||
This is not a test: no-test.js | ||
normal.bar | ||
✓ should do nothing but register the test | ||
normal.bar.js | ||
✓ should do nothing but register the test | ||
normal.js | ||
✓ should do nothing but register the test | ||
``` |
Oops, something went wrong.