Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Remove trailing whitespace

Javier Aranda8047de5220ef
diff --git a/History.md b/History.md
index 17ff63b7..9bad8355 100644
--- a/History.md
+++ b/History.md
@@ -1,5 +1,5 @@
-1.8.1 / 2013-01-09
+1.8.1 / 2013-01-09
==================
* fix .bail() arity check causing it to default to true
diff --git a/Readme.md b/Readme.md
index d73e1f30..cd481222 100644
--- a/Readme.md
+++ b/Readme.md
@@ -13,7 +13,7 @@ repo age : 1 year, 3 months
active : 233 days
commits : 1034
files : 114
-authors :
+authors :
451 TJ Holowaychuk 43.6%
389 Tj Holowaychuk 37.6%
31 Guillermo Rauch 3.0%
@@ -33,4 +33,4 @@ authors :
- [Google Group](http://groups.google.com/group/mochajs)
- [Wiki](https://github.com/visionmedia/mocha/wiki)
- - Mocha [Extensions and reporters](https://github.com/visionmedia/mocha/wiki)
\ No newline at end of file
+ - Mocha [Extensions and reporters](https://github.com/visionmedia/mocha/wiki)
diff --git a/lib/browser/debug.js b/lib/browser/debug.js
index 946f4abf..03cf5923 100644
--- a/lib/browser/debug.js
+++ b/lib/browser/debug.js
@@ -1,6 +1,5 @@
module.exports = function(type){
return function(){
-
}
-};
\ No newline at end of file
+};
diff --git a/lib/hook.js b/lib/hook.js
index d6b45da9..814e7b62 100644
--- a/lib/hook.js
+++ b/lib/hook.js
@@ -47,4 +47,3 @@ Hook.prototype.error = function(err){
this._error = err;
};
-
diff --git a/lib/interfaces/bdd.js b/lib/interfaces/bdd.js
index b46d1697..96b12c8b 100644
--- a/lib/interfaces/bdd.js
+++ b/lib/interfaces/bdd.js
@@ -8,7 +8,7 @@ var Suite = require('../suite')
/**
* BDD-style interface:
- *
+ *
* describe('Array', function(){
* describe('#indexOf()', function(){
* it('should return -1 when not present', function(){
@@ -20,7 +20,7 @@ var Suite = require('../suite')
* });
* });
* });
- *
+ *
*/
module.exports = function(suite){
@@ -65,7 +65,7 @@ module.exports = function(suite){
* and callback `fn` containing nested suites
* and/or tests.
*/
-
+
context.describe = context.context = function(title, fn){
var suite = Suite.create(suites[0], title);
suites.unshift(suite);
diff --git a/lib/interfaces/exports.js b/lib/interfaces/exports.js
index b22607e0..6b229c0f 100644
--- a/lib/interfaces/exports.js
+++ b/lib/interfaces/exports.js
@@ -8,19 +8,19 @@ var Suite = require('../suite')
/**
* TDD-style interface:
- *
+ *
* exports.Array = {
* '#indexOf()': {
* 'should return -1 when the value is not present': function(){
- *
+ *
* },
*
* 'should return the correct index when the value is present': function(){
- *
+ *
* }
* }
* };
- *
+ *
*/
module.exports = function(suite){
@@ -57,4 +57,4 @@ module.exports = function(suite){
}
}
}
-};
\ No newline at end of file
+};
diff --git a/lib/interfaces/qunit.js b/lib/interfaces/qunit.js
index cd03ab6b..9376c84a 100644
--- a/lib/interfaces/qunit.js
+++ b/lib/interfaces/qunit.js
@@ -8,27 +8,27 @@ var Suite = require('../suite')
/**
* QUnit-style interface:
- *
+ *
* suite('Array');
- *
+ *
* test('#length', function(){
* var arr = [1,2,3];
* ok(arr.length == 3);
* });
- *
+ *
* test('#indexOf()', function(){
* var arr = [1,2,3];
* ok(arr.indexOf(1) == 0);
* ok(arr.indexOf(2) == 1);
* ok(arr.indexOf(3) == 2);
* });
- *
+ *
* suite('String');
- *
+ *
* test('#length', function(){
* ok('foo'.length == 3);
* });
- *
+ *
*/
module.exports = function(suite){
@@ -71,7 +71,7 @@ module.exports = function(suite){
/**
* Describe a "suite" with the given `title`.
*/
-
+
context.suite = function(title){
if (suites.length > 1) suites.shift();
var suite = Suite.create(suites[0], title);
diff --git a/lib/interfaces/tdd.js b/lib/interfaces/tdd.js
index a252afcd..e3d5ef26 100644
--- a/lib/interfaces/tdd.js
+++ b/lib/interfaces/tdd.js
@@ -14,7 +14,7 @@ var Suite = require('../suite')
* suiteSetup(function(){
*
* });
- *
+ *
* test('should return -1 when not present', function(){
*
* });
diff --git a/lib/reporters/base.js b/lib/reporters/base.js
index 24072ebb..38404ac5 100644
--- a/lib/reporters/base.js
+++ b/lib/reporters/base.js
@@ -64,7 +64,7 @@ exports.colors = {
/**
* Default symbol map.
*/
-
+
exports.symbols = {
ok: '✓',
err: '✖',
diff --git a/lib/reporters/min.js b/lib/reporters/min.js
index 9eb261e6..1b6117d0 100644
--- a/lib/reporters/min.js
+++ b/lib/reporters/min.js
@@ -20,7 +20,7 @@ exports = module.exports = Min;
function Min(runner) {
Base.call(this, runner);
-
+
runner.on('start', function(){
// clear screen
process.stdout.write('\u001b[2J');
@@ -35,4 +35,4 @@ function Min(runner) {
* Inherit from `Base.prototype`.
*/
-Min.prototype.__proto__ = Base.prototype;
\ No newline at end of file
+Min.prototype.__proto__ = Base.prototype;
diff --git a/lib/reporters/templates/coverage.jade b/lib/reporters/templates/coverage.jade
index ca842ed1..b78119fb 100644
--- a/lib/reporters/templates/coverage.jade
+++ b/lib/reporters/templates/coverage.jade
@@ -34,12 +34,12 @@ html
tbody
for line, number in file.source
if line.coverage > 0
- tr.hit
+ tr.hit
td.line= number
td.hits= line.coverage
td.source= line.source
else if 0 === line.coverage
- tr.miss
+ tr.miss
td.line= number
td.hits 0
td.source= line.source
@@ -47,4 +47,4 @@ html
tr
td.line= number
td.hits
- td.source= line.source || ' '
\ No newline at end of file
+ td.source= line.source || ' '
diff --git a/lib/reporters/xunit.js b/lib/reporters/xunit.js
index c58f51f3..702aa3ce 100644
--- a/lib/reporters/xunit.js
+++ b/lib/reporters/xunit.js
@@ -39,7 +39,7 @@ function XUnit(runner) {
runner.on('pass', function(test){
tests.push(test);
});
-
+
runner.on('fail', function(test){
tests.push(test);
});
@@ -56,7 +56,7 @@ function XUnit(runner) {
}, false));
tests.forEach(test);
- console.log('</testsuite>');
+ console.log('</testsuite>');
});
}
diff --git a/lib/utils.js b/lib/utils.js
index 5142e06c..2bf0978a 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -63,7 +63,7 @@ exports.indexOf = function(arr, obj, start){
/**
* Array#reduce (<=IE8)
- *
+ *
* @param {Array} array
* @param {Function} fn
* @param {Object} initial value
diff --git a/support/compile.js b/support/compile.js
index a8e047dd..39a53222 100644
--- a/support/compile.js
+++ b/support/compile.js
@@ -95,11 +95,11 @@ function compile() {
// https://github.com/weepy/brequire/blob/master/browser/brequire.js
var browser = {
-
+
/**
* Require a module.
*/
-
+
require: function require(p){
var path = require.resolve(p)
, mod = require.modules[path];
@@ -110,7 +110,7 @@ var browser = {
}
return mod.exports;
},
-
+
/**
* Resolve module path.
*/
@@ -123,7 +123,7 @@ var browser = {
|| require.modules[index] && index
|| orig;
},
-
+
/**
* Return relative require().
*/
@@ -131,11 +131,11 @@ var browser = {
relative: function(parent) {
return function(p){
if ('.' != p.charAt(0)) return require(p);
-
+
var path = parent.split('/')
, segs = p.split('/');
path.pop();
-
+
for (var i = 0; i < segs.length; i++) {
var seg = segs[i];
if ('..' == seg) path.pop();
@@ -145,7 +145,7 @@ var browser = {
return require(path.join('/'));
};
},
-
+
/**
* Register a module.
*/
diff --git a/support/head.js b/support/head.js
index aad8ad25..55d38175 100644
--- a/support/head.js
+++ b/support/head.js
@@ -1,2 +1 @@
;(function(){
-
diff --git a/test/acceptance/duration.js b/test/acceptance/duration.js
index e814ff29..1f4c5c86 100644
--- a/test/acceptance/duration.js
+++ b/test/acceptance/duration.js
@@ -7,7 +7,7 @@ describe('durations', function(){
}, 100);
})
})
-
+
describe('when reasonable', function(){
it('should highlight in yellow', function(done){
setTimeout(function(){
@@ -15,7 +15,7 @@ describe('durations', function(){
}, 50);
})
})
-
+
describe('when fast', function(){
it('should highlight in green', function(done){
setTimeout(function(){
@@ -23,4 +23,4 @@ describe('durations', function(){
}, 10);
})
})
-})
\ No newline at end of file
+})
diff --git a/test/acceptance/globals.js b/test/acceptance/globals.js
index cc8cf598..815eaee5 100644
--- a/test/acceptance/globals.js
+++ b/test/acceptance/globals.js
@@ -5,7 +5,7 @@ describe('global leaks', function(){
// foo = 'hey';
// bar = 'hey';
})
-
+
beforeEach(function(){
// uncomment to test
// foo = 'bar'
@@ -39,4 +39,4 @@ describe('global leaks', function(){
// uncomment to test
// foo = 'bar'
});
-});
\ No newline at end of file
+});
diff --git a/test/acceptance/interfaces/bdd.js b/test/acceptance/interfaces/bdd.js
index f738f883..f536aa01 100644
--- a/test/acceptance/interfaces/bdd.js
+++ b/test/acceptance/interfaces/bdd.js
@@ -5,7 +5,7 @@ describe('Array', function(){
[1,2,3].indexOf(5).should.equal(-1);
[1,2,3].indexOf(0).should.equal(-1);
})
-
+
it('should return the correct index when the value is present', function(){
[1,2,3].indexOf(1).should.equal(0);
[1,2,3].indexOf(2).should.equal(1);
diff --git a/test/acceptance/interfaces/exports.js b/test/acceptance/interfaces/exports.js
index 8746cbcc..c93bf282 100644
--- a/test/acceptance/interfaces/exports.js
+++ b/test/acceptance/interfaces/exports.js
@@ -5,7 +5,7 @@ exports.Array = {
before: function(){
calls.push('before');
},
-
+
after: function(){
calls.push('after');
calls.should.eql([
@@ -23,7 +23,7 @@ exports.Array = {
beforeEach: function(){
calls.push('before each');
},
-
+
afterEach: function(){
calls.push('after each');
},
@@ -33,7 +33,7 @@ exports.Array = {
[1,2,3].indexOf(5).should.equal(-1);
[1,2,3].indexOf(0).should.equal(-1);
},
-
+
'should return the correct index when the value is present': function(){
calls.push('two');
[1,2,3].indexOf(1).should.equal(0);
diff --git a/test/acceptance/interfaces/tdd.js b/test/acceptance/interfaces/tdd.js
index 674dafaa..906b0558 100644
--- a/test/acceptance/interfaces/tdd.js
+++ b/test/acceptance/interfaces/tdd.js
@@ -14,9 +14,9 @@ suite('Array', function(){
[1,2,3].indexOf(5).should.equal(-1);
[1,2,3].indexOf(0).should.equal(-1);
});
-
+
test('should return the correct index when the value is present', function(){
- initialValue.should.eql(42);
+ initialValue.should.eql(42);
[1,2,3].indexOf(1).should.equal(0);
[1,2,3].indexOf(2).should.equal(1);
[1,2,3].indexOf(3).should.equal(2);
diff --git a/test/acceptance/misc/asyncOnly.js b/test/acceptance/misc/asyncOnly.js
index 8b5b5f09..e03251f3 100644
--- a/test/acceptance/misc/asyncOnly.js
+++ b/test/acceptance/misc/asyncOnly.js
@@ -1,7 +1,7 @@
describe('asyncOnly', function(){
it('should display an error', function(){
-
+
})
it('should pass', function(done){
diff --git a/test/acceptance/misc/bail.js b/test/acceptance/misc/bail.js
index 8f35b0f4..25b0c10f 100644
--- a/test/acceptance/misc/bail.js
+++ b/test/acceptance/misc/bail.js
@@ -14,4 +14,3 @@ describe('bail-2', function(){
throw new Error('this should not be displayed');
})
})
-
diff --git a/test/acceptance/misc/cascade.js b/test/acceptance/misc/cascade.js
index 7f5e585a..0f884a00 100644
--- a/test/acceptance/misc/cascade.js
+++ b/test/acceptance/misc/cascade.js
@@ -3,11 +3,11 @@ describe('one', function(){
before(function(){
console.log('before one');
})
-
+
after(function(){
console.log('after one');
})
-
+
beforeEach(function(){
console.log(' before each one');
})
@@ -20,24 +20,24 @@ describe('one', function(){
before(function(){
console.log(' before two');
})
-
+
after(function(){
console.log(' after two');
})
-
+
beforeEach(function(){
console.log(' before each two');
})
-
+
afterEach(function(){
console.log(' after each two');
})
-
+
describe('three', function(){
before(function(){
console.log(' before three');
})
-
+
after(function(){
console.log(' after three');
})
@@ -45,14 +45,14 @@ describe('one', function(){
beforeEach(function(){
console.log(' before each three');
})
-
+
afterEach(function(){
console.log(' after each three');
})
it('should three', function(){
console.log(' TEST three');
- })
+ })
})
})
})
diff --git a/test/acceptance/misc/grep.js b/test/acceptance/misc/grep.js
index d40effb1..9bfe0c5f 100644
--- a/test/acceptance/misc/grep.js
+++ b/test/acceptance/misc/grep.js
@@ -2,11 +2,11 @@
describe('grep', function(){
describe('fast', function(){
it('should run fast', function(){
-
+
})
-
+
it('should run fast again', function(){
-
+
})
})
@@ -14,7 +14,7 @@ describe('grep', function(){
it('should run slow', function(done){
setTimeout(done, 1000);
})
-
+
it('should run slow again', function(done){
setTimeout(done, 1000);
})
diff --git a/test/acceptance/misc/nontty.js b/test/acceptance/misc/nontty.js
index 497c2b61..cd96f1fc 100644
--- a/test/acceptance/misc/nontty.js
+++ b/test/acceptance/misc/nontty.js
@@ -1,10 +1,10 @@
describe('tests for non-tty', function(){
it('should pass', function(){
-
+
})
-
+
it('should fail', function(){
throw new Error('oh noes')
})
-})
\ No newline at end of file
+})
diff --git a/test/acceptance/timeout.js b/test/acceptance/timeout.js
index 99049ed1..109808bf 100644
--- a/test/acceptance/timeout.js
+++ b/test/acceptance/timeout.js
@@ -19,4 +19,3 @@ describe('timeouts', function(){
}, 300);
})
})
-
diff --git a/test/hook.async.js b/test/hook.async.js
index f235a005..221bebf1 100644
--- a/test/hook.async.js
+++ b/test/hook.async.js
@@ -5,7 +5,7 @@ describe('async', function(){
before(function(){
calls.push('root before all');
})
-
+
after(function(){
calls.push('root after all');
calls.should.eql([
@@ -33,27 +33,27 @@ describe('async', function(){
beforeEach(function(){
calls.push('parent before');
})
-
+
afterEach(function(){
calls.push('parent after' );
})
-
+
describe('hooks', function(){
before(function(){
calls.push('before all');
});
-
+
after(function(){
calls.push('after all');
});
-
+
beforeEach(function(done){
process.nextTick(function(){
calls.push('before');
done();
})
})
-
+
it('one', function(done){
calls.should.eql([
'root before all'
@@ -63,7 +63,7 @@ describe('async', function(){
calls.push('one');
process.nextTick(done);
})
-
+
it('two', function(){
calls.should.eql([
'root before all'
@@ -77,7 +77,7 @@ describe('async', function(){
, 'before']);
calls.push('two');
})
-
+
it('three', function(){
calls.should.eql([
'root before all'
@@ -96,7 +96,7 @@ describe('async', function(){
, 'before']);
calls.push('three');
})
-
+
afterEach(function(done){
process.nextTick(function(){
calls.push('after');
diff --git a/test/hook.sync.nested.js b/test/hook.sync.nested.js
index 95d3ba8f..22907a5b 100644
--- a/test/hook.sync.nested.js
+++ b/test/hook.sync.nested.js
@@ -23,12 +23,12 @@ describe('serial', function(){
, 'parent after'
, 'parent before']);
})
-
+
describe('hooks', function(){
beforeEach(function(){
calls.push('before');
})
-
+
it('one', function(){
calls.should.eql([
'parent before'
@@ -40,7 +40,7 @@ describe('serial', function(){
, 'before']);
calls.push('one');
})
-
+
it('two', function(){
calls.should.eql([
'parent before'
@@ -57,10 +57,10 @@ describe('serial', function(){
, 'before']);
calls.push('two');
});
-
+
afterEach(function(){
calls.push('after');
})
})
})
-})
\ No newline at end of file
+})
diff --git a/test/runnable.js b/test/runnable.js
index ed3563d0..ff94bdeb 100644
--- a/test/runnable.js
+++ b/test/runnable.js
@@ -62,7 +62,7 @@ describe('Runnable(title, fn)', function(){
run.sync.should.be.false;
})
})
-
+
describe('when arity == 0', function(){
it('should be .sync', function(){
var run = new Runnable('foo', function(){});
diff --git a/test/suite.js b/test/suite.js
index e04bf5d7..8cacff8d 100644
--- a/test/suite.js
+++ b/test/suite.js
@@ -231,15 +231,15 @@ describe('Suite', function(){
// this.test = new Test('test');
// this.suite.addTest(this.test);
// });
- //
+ //
// it('sets the parent on the added test', function(){
// this.test.parent.should.equal(this.suite);
// });
- //
+ //
// it('copies the timeout value', function(){
// this.test.timeout().should.equal(4002);
// });
- //
+ //
// it('adds the test to the tests collection', function(){
// this.suite.tests.should.have.length(1);
// this.suite.tests[0].should.equal(this.test);
@@ -304,7 +304,7 @@ describe('Suite', function(){
it('should return the number', function(){
this.suite.addTest(new Test('a child test'));
this.suite.addTest(new Test('another child test'));
-
+
var n = 0;
function fn(){ n++; }
this.suite.eachTest(fn);
@@ -318,7 +318,7 @@ describe('Suite', function(){
var suite = new Suite('a child suite');
suite.addTest(new Test('a test in a child suite'));
this.suite.addSuite(suite);
-
+
var n = 0;
function fn(){ n++; }
this.suite.eachTest(fn);