☕️ Classic, reliable, trusted test framework for Node.js and the browser
Added mocha.opts support. Closes #31
Tj Holowaychukaec68b79c060
diff --git a/Makefile b/Makefileindex 98138ff8..d2acf3a8 100644--- a/Makefile+++ b/Makefile@@ -8,29 +8,23 @@ test-all: test-bdd test-tdd test-exports test-unit test-greptest-unit:@./bin/mocha \- --require should \--reporter $(REPORTER) \- --ui bdd \- --growl \$(TESTS)test-bdd:@./bin/mocha \- --require should \--reporter $(REPORTER) \--ui bdd \test/bddtest-tdd:@./bin/mocha \- --require should \--reporter $(REPORTER) \--ui tdd \test/tddtest-exports:@./bin/mocha \- --require should \--reporter $(REPORTER) \--ui exports \test/exportsdiff --git a/bin/mocha b/bin/mochaindex 759167a4..9e367ca7 100755--- a/bin/mocha+++ b/bin/mocha@@ -56,6 +56,18 @@ program.on('require', function(mod){require(mod);});+// mocha.opts support++try {+ var opts = fs.readFileSync('test/mocha.opts', 'utf8');+ opts = opts.split(/\s+/);+ process.argv = process.argv+ .slice(0, 2)+ .concat(opts.concat(process.argv.slice(2)));+} catch (err) {+ // ignore+}+// parse argsprogram.parse(process.argv);diff --git a/test/mocha.opts b/test/mocha.optsnew file mode 100644index 00000000..7104117c--- /dev/null+++ b/test/mocha.opts@@ -0,0 +1,4 @@+--require should+--reporter dot+--ui bdd+--growl