Skip to content

Commit

Permalink
failing test for t.only() firing tests unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Sep 4, 2013
1 parent a3d85bb commit bd3f198
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/only.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var tape = require('../');
tap.test('tape only test', function (tt) {
var test = tape.createHarness({ exit: false });
var tc = tap.createConsumer();
var ran = [];

var rows = []
tc.on('data', function (r) { rows.push(r) })
Expand All @@ -25,23 +26,27 @@ tap.test('tape only test', function (tt) {
'pass 1',
'ok'
])
tt.deepEqual(ran, [ 3 ]);

tt.end()
})

test.createStream().pipe(tc)

test("never run fail", function (t) {
ran.push(1);
t.equal(true, false)
t.end()
})

test("never run success", function (t) {
ran.push(2);
t.equal(true, true)
t.end()
})

test.only("run success", function (t) {
ran.push(3);
t.ok(true, "assert name")
t.end()
})
Expand Down

0 comments on commit bd3f198

Please sign in to comment.