Skip to content

Commit 5c21092

Browse files
committed
cleanup
1 parent e4f8f53 commit 5c21092

File tree

5 files changed

+4
-123
lines changed

5 files changed

+4
-123
lines changed

index.js

-27
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ var Runner = require('./lib/runner');
77
var log = new Squeak({separator: ' '});
88
var runner = new Runner();
99

10-
/**
11-
* Add log types
12-
*/
13-
1410
log.type('success', {
1511
color: 'green',
1612
prefix: figures.tick
@@ -21,14 +17,6 @@ log.type('error', {
2117
prefix: figures.cross
2218
});
2319

24-
/**
25-
* Handle test
26-
*
27-
* @param {Object} err
28-
* @param {String} title
29-
* @api private
30-
*/
31-
3220
function test(err, title) {
3321
if (err) {
3422
log.error(title, chalk.red(err.message));
@@ -38,13 +26,6 @@ function test(err, title) {
3826
log.success(title);
3927
}
4028

41-
/**
42-
* Show stack for each failed test
43-
*
44-
* @param {Array} results
45-
* @api private
46-
*/
47-
4829
function stack(results) {
4930
var i = 0;
5031

@@ -61,14 +42,6 @@ function stack(results) {
6142
});
6243
}
6344

64-
/**
65-
* Show summary and exit
66-
*
67-
* @param {Object} stats
68-
* @param {Array} results
69-
* @api private
70-
*/
71-
7245
function exit(stats, results) {
7346
if (stats.testCount > 0) {
7447
log.write();

lib/runner.js

-51
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ var each = require('each-async');
55
var eachSerial = require('async-each-series');
66
var Test = require('./test');
77

8-
/**
9-
* Initialize a new `Runner`
10-
*
11-
* @param {Object} opts
12-
* @api public
13-
*/
14-
158
function Runner(opts) {
169
if (!(this instanceof Runner)) {
1710
return new Runner(opts);
@@ -31,39 +24,16 @@ function Runner(opts) {
3124
util.inherits(Runner, EventEmitter);
3225
module.exports = Runner;
3326

34-
/**
35-
* Add concurrent test to `Runner`
36-
*
37-
* @param {String} title
38-
* @param {Function} cb
39-
* @api public
40-
*/
41-
4227
Runner.prototype.addTest = function (title, cb) {
4328
this.stats.testCount++;
4429
this.tests.concurrent.push(new Test(title, cb));
4530
};
4631

47-
/**
48-
* Add serial test to `Runner`
49-
*
50-
* @param {String} title
51-
* @param {Function} cb
52-
* @api public
53-
*/
54-
5532
Runner.prototype.addSerialTest = function (title, cb) {
5633
this.stats.testCount++;
5734
this.tests.serial.push(new Test(title, cb));
5835
};
5936

60-
/**
61-
* Run concurrent tests
62-
*
63-
* @param {Function} cb
64-
* @api private
65-
*/
66-
6737
Runner.prototype.concurrent = function (cb) {
6838
each(this.tests.concurrent, function (test, i, next) {
6939
test.run(function (err) {
@@ -82,13 +52,6 @@ Runner.prototype.concurrent = function (cb) {
8252
}.bind(this), cb);
8353
};
8454

85-
/**
86-
* Run serial tests
87-
*
88-
* @param {Function} cb
89-
* @api private
90-
*/
91-
9255
Runner.prototype.serial = function (cb) {
9356
eachSerial(this.tests.serial, function (test, next) {
9457
test.run(function (err) {
@@ -107,13 +70,6 @@ Runner.prototype.serial = function (cb) {
10770
}.bind(this), cb);
10871
};
10972

110-
/**
111-
* Run the `Runner`
112-
*
113-
* @param {Function} cb
114-
* @api public
115-
*/
116-
11773
Runner.prototype.run = function (cb) {
11874
var concurrent = this.tests.concurrent;
11975
var serial = this.tests.serial;
@@ -136,13 +92,6 @@ Runner.prototype.run = function (cb) {
13692
this.end(cb);
13793
};
13894

139-
/**
140-
* Handle completion
141-
*
142-
* @param {Function} cb
143-
* @api private
144-
*/
145-
14695
Runner.prototype.end = function (cb) {
14796
this.stats.passCount = this.stats.testCount - this.stats.failCount;
14897
cb(this.stats, this.results);

lib/test.js

-40
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ var EventEmitter = require('events').EventEmitter;
55
var fnName = require('fn-name');
66
var claim = require('claim');
77

8-
/**
9-
* Initialize a new `Test`
10-
*
11-
* @param {String} title
12-
* @param {Function} fn
13-
* @api public
14-
*/
15-
168
function Test(title, fn) {
179
if (!(this instanceof Test)) {
1810
return new Test(title, fn);
@@ -56,13 +48,6 @@ Object.keys(claim).forEach(function (el) {
5648
};
5749
});
5850

59-
/**
60-
* Plan number of assertions
61-
*
62-
* @param {Number} count
63-
* @api public
64-
*/
65-
6651
Test.prototype.plan = function (count) {
6752
if (typeof count !== 'number') {
6853
throw new TypeError('Expected a number');
@@ -71,23 +56,10 @@ Test.prototype.plan = function (count) {
7156
this.planCount = count;
7257
};
7358

74-
/**
75-
* Skip test
76-
*
77-
* @api public
78-
*/
79-
8059
Test.prototype.skip = function () {
8160
this.skipTest = true;
8261
};
8362

84-
/**
85-
* Run test
86-
*
87-
* @param {Function} cb
88-
* @api public
89-
*/
90-
9163
Test.prototype.run = function (cb) {
9264
this.cb = cb;
9365

@@ -116,12 +88,6 @@ Test.prototype.run = function (cb) {
11688
}
11789
};
11890

119-
/**
120-
* End test
121-
*
122-
* @api public
123-
*/
124-
12591
Test.prototype.end = function () {
12692
if (this.endCalled) {
12793
throw new Error('.end() called more than once');
@@ -131,12 +97,6 @@ Test.prototype.end = function () {
13197
this.exit();
13298
};
13399

134-
/**
135-
* Exit test
136-
*
137-
* @api private
138-
*/
139-
140100
Test.prototype.exit = function () {
141101
if (this.planCount !== null && this.planCount !== this.assertCount) {
142102
this.assertError = new assert.AssertionError({

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "Simple concurrent test runner",
55
"license": "MIT",
66
"repository": "sindresorhus/ava",
7-
"bin": "cli.js",
87
"maintainers": [
98
{
109
"name": "Sindre Sorhus",
@@ -17,11 +16,12 @@
1716
"url": "github.com/kevva"
1817
}
1918
],
19+
"bin": "cli.js",
2020
"engines": {
2121
"node": ">=0.10.0"
2222
},
2323
"scripts": {
24-
"test": "xo && node cli.js test/test.js | faucet"
24+
"test": "xo && node test/test.js | tap-dot"
2525
},
2626
"files": [
2727
"index.js",
@@ -36,6 +36,7 @@
3636
"runner",
3737
"concurrent",
3838
"parallel",
39+
"fast",
3940
"tape",
4041
"tap",
4142
"mocha",
@@ -56,7 +57,6 @@
5657
"update-notifier": "^0.5.0"
5758
},
5859
"devDependencies": {
59-
"faucet": "^0.0.1",
6060
"pinkie-promise": "^1.0.0",
6161
"tape": "^4.0.0",
6262
"xo": "*"

readme.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Ava accepts files/folders/globs.
3131
var test = require('ava');
3232

3333
test('test something', function (t) {
34-
t.assert(true);
3534
t.is('unicorn', 'unicorn');
3635
t.end();
3736
});
@@ -46,7 +45,7 @@ $ npm test
4645

4746
## Credit
4847

49-
[![Sindre Sorhus](http://gravatar.com/avatar/d36a92237c75c5337c17b60d90686bf9?s=144)](http://sindresorhus.com) | [![Kevin Mårtensson](http://gravatar.com/avatar/48fa294e3cd41680b80d3ed6345c7b4d?s=144)](https://github.com/kevva)
48+
[![Sindre Sorhus](http://gravatar.com/avatar/d36a92237c75c5337c17b60d90686bf9?s=120)](http://sindresorhus.com) | [![Kevin Mårtensson](http://gravatar.com/avatar/48fa294e3cd41680b80d3ed6345c7b4d?s=120)](https://github.com/kevva)
5049
---|---
5150
[Sindre Sorhus](http://sindresorhus.com) | [Kevin Mårtensson](https://github.com/kevva)
5251

0 commit comments

Comments
 (0)