Skip to content

Commit 367db82

Browse files
author
taylorhakes
committed
Removed unreachable Results.prototype.only code
1 parent 0d078f3 commit 367db82

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

lib/results.js

-5
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ Results.prototype.push = function (t) {
8484
};
8585

8686
Results.prototype.only = function (name) {
87-
if (this._only) {
88-
self.count ++;
89-
self.fail ++;
90-
write('not ok ' + self.count + ' already called .only()\n');
91-
}
9287
this._only = name;
9388
};
9489

test/only-twice.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
var tape = require('../');
2+
var tap = require('tap');
3+
4+
tap.test('only twice error', function (assert) {
5+
var test = tape.createHarness({ exit : false });
6+
7+
test.only("first only", function (t) {
8+
t.end()
9+
});
10+
11+
assert.throws(function() {
12+
test.only('second only', function(t) {
13+
t.end();
14+
});
15+
}, {
16+
name: 'Error',
17+
message: 'there can only be one only test'
18+
});
19+
assert.end();
20+
});
21+

0 commit comments

Comments
 (0)