Skip to content

Commit 39d465b

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

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-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

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

0 commit comments

Comments
 (0)