Permalink
Browse files

merge

  • Loading branch information...
2 parents 10475e3 + cc74060 commit bde8e54d489f6fca696010c6900db04bce6e6889 @tj tj committed Jan 8, 2013
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
@@ -9,3 +9,5 @@ test.js
my-reporter.js
*.sw*
lib/browser/diff.js
+.idea
+*.iml
View
@@ -165,7 +165,7 @@ function HTML(runner, root) {
on(h2, 'click', function(){
pre.style.display = 'none' == pre.style.display
- ? 'inline-block'
+ ? 'block'
: 'none';
});
View
@@ -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
@@ -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,11 +1021,25 @@ 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`.
*
@@ -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';
});

0 comments on commit bde8e54

Please sign in to comment.