Skip to content

armgit / mocha

Public Imported from GitHub
0

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

docs

Tj Holowaychukb6bf622984a1
diff --git a/Readme.md b/Readme.md
index e6f9f24d..5139e4ba 100644
--- a/Readme.md
+++ b/Readme.md
@@ -1,7 +1,7 @@
# mocha
- Mocha aims to take the best of several popular frameworks. BDD-style inspired by JSpec, parallelism inspired by Expresso, opt-in serial execution from Vows, and assertion expectancy from Qunit.
+ Mocha aims to take the best of several popular frameworks. BDD-style inspired by JSpec, parallelism inspired by Expresso, opt-in serial execution from Vows, and assertion expectancy from Qunit, as well as bits from others.
## Features
diff --git a/lib/runner.js b/lib/runner.js
index 87bcc07e..2dab1e30 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -5,6 +5,10 @@
var EventEmitter = require('events').EventEmitter;
+/**
+ * Expose `Runner`.
+ */
+
module.exports = Runner;
/**
@@ -35,6 +39,15 @@ function Runner(suite) {
Runner.prototype.__proto__ = EventEmitter.prototype;
+/**
+ * Run tests in the given `suite` and invoke
+ * the callback `fn()` when complete.
+ *
+ * @param {Suite} suite
+ * @param {Function} fn
+ * @api private
+ */
+
Runner.prototype.runTests = function(suite, fn){
var self = this
, tests = suite.tests;
@@ -78,6 +91,15 @@ Runner.prototype.runTests = function(suite, fn){
run(tests.shift());
};
+/**
+ * Run the given `suite` and invoke the
+ * callback `fn()` when complete.
+ *
+ * @param {Suite} suite
+ * @param {Function} fn
+ * @api private
+ */
+
Runner.prototype.runSuite = function(suite, fn){
var self = this;
@@ -97,6 +119,12 @@ Runner.prototype.runSuite = function(suite, fn){
});
};
+/**
+ * Run the root suite.
+ *
+ * @api public
+ */
+
Runner.prototype.run = function(){
var self = this;
this.emit('start');