Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jan 8, 2013
2 parents 10475e3 + cc74060 commit bde8e54
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ test.js
my-reporter.js
*.sw*
lib/browser/diff.js
.idea
*.iml
2 changes: 1 addition & 1 deletion lib/reporters/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function HTML(runner, root) {

on(h2, 'click', function(){
pre.style.display = 'none' == pre.style.display
? 'inline-block'
? 'block'
: 'none';
});

Expand Down
5 changes: 4 additions & 1 deletion mocha.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ body {

#mocha .test {
margin-left: 15px;
overflow: hidden;
}

#mocha .test.pending:hover h2::after {
Expand Down Expand Up @@ -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;
Expand Down
19 changes: 17 additions & 2 deletions mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`.
*
Expand All @@ -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
*/

Expand Down Expand Up @@ -2073,7 +2088,7 @@ function HTML(runner, root) {

on(h2, 'click', function(){
pre.style.display = 'none' == pre.style.display
? 'inline-block'
? 'block'
: 'none';
});

Expand Down

0 comments on commit bde8e54

Please sign in to comment.