Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

mocha.opts docs

Tj Holowaychukac3151d79790
diff --git a/Readme.md b/Readme.md
index 28e83cef..6084f2e2 100644
--- a/Readme.md
+++ b/Readme.md
@@ -214,6 +214,30 @@ module.exports = {
## Best practices
+### test/*
+
+ By default `mocha(1)` will use the pattern `./test/*.js`, so
+ it's usually a good place to put your tests.
+
+### mocha.opts
+
+ Mocha will attempt to load `./test/mocha.opts`, these are concatenated with `process.argv`, though command-line args will take precedence. For example suppose you have the following _mocha.opts_ file:
+
+```
+--require should
+--reporter dot
+--ui bdd
+```
+
+ This will default the reporter to `dot`, require the `should` library,
+ and use `bdd` as the interface. With this you may then invoke `mocha(1)`
+ with additional arguments, here enabling growl support and changing
+ the reporter to `spec`:
+
+```
+$ mocha --reporter list --growl
+```
+
### Makefiles
Be kind and don't make developers hunt around in your docs to figure