Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

merge

  • Loading branch information...
commit bde8e54d489f6fca696010c6900db04bce6e6889 2 parents 10475e3 + cc74060
@tj tj authored
Showing with 24 additions and 4 deletions.
  1. +2 −0  .gitignore
  2. +1 −1  lib/reporters/html.js
  3. +4 −1 mocha.css
  4. +17 −2 mocha.js
View
2  .gitignore
@@ -9,3 +9,5 @@ test.js
my-reporter.js
*.sw*
lib/browser/diff.js
+.idea
+*.iml
View
2  lib/reporters/html.js
@@ -165,7 +165,7 @@ function HTML(runner, root) {
on(h2, 'click', function(){
pre.style.display = 'none' == pre.style.display
- ? 'inline-block'
+ ? 'block'
: 'none';
});
View
5 mocha.css
@@ -53,6 +53,7 @@ body {
#mocha .test {
margin-left: 15px;
+ overflow: hidden;
}
#mocha .test.pending:hover h2::after {
@@ -129,7 +130,9 @@ body {
}
#mocha .test pre {
- display: inline-block;
+ display: block;
+ float: left;
+ clear: left;
font: 12px/1.5 monaco, monospace;
margin: 5px;
padding: 15px;
View
19 mocha.js
@@ -1005,6 +1005,7 @@ function image(name) {
* - `reporter` reporter instance, defaults to `mocha.reporters.Dot`
* - `globals` array of accepted globals
* - `timeout` timeout in milliseconds
+ * - `bail` bail on the first test failure
* - `slow` milliseconds to wait before considering a test slow
* - `ignoreLeaks` ignore global leaks
* - `grep` string or regexp to filter tests with
@@ -1020,12 +1021,26 @@ function Mocha(options) {
this.grep(options.grep);
this.suite = new exports.Suite('', new exports.Context);
this.ui(options.ui);
+ this.bail(options.bail);
this.reporter(options.reporter);
if (options.timeout) this.timeout(options.timeout);
if (options.slow) this.slow(options.slow);
}
/**
+ * Enable or disable bailing on the first failure.
+ *
+ * @param {Boolean} [bail]
+ * @api public
+ */
+
+Mocha.prototype.bail = function(bail){
+ if (null == bail) bail = true;
+ this.suite.bail(bail);
+ return this;
+};
+
+/**
* Add test `file`.
*
* @param {String} file
@@ -1040,7 +1055,7 @@ Mocha.prototype.addFile = function(file){
/**
* Set reporter to `reporter`, defaults to "dot".
*
- * @param {String|Function} reporter name of a reporter or a reporter constructor
+ * @param {String|Function} reporter name or constructor
* @api public
*/
@@ -2073,7 +2088,7 @@ function HTML(runner, root) {
on(h2, 'click', function(){
pre.style.display = 'none' == pre.style.display
- ? 'inline-block'
+ ? 'block'
: 'none';
});
Please sign in to comment.
Something went wrong with that request. Please try again.