Launch Week Day 3: Introducing Organization Notifications in Socket.Learn More
Socket
Book a DemoSign in
Socket

tape

Package Overview
Dependencies
Maintainers
1
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tape - npm Package Compare versions

Comparing version
0.2.0
to
0.2.1
+48
test/only.js
var tap = require('tap');
var tape = require('../');
tap.test('tape only test', function (tt) {
var test = tape.createHarness({ exit: false });
var tc = tap.createConsumer();
var rows = []
tc.on('data', function (r) { rows.push(r) })
tc.on('end', function () {
var rs = rows.map(function (r) {
if (r && typeof r === 'object') {
return { id: r.id, ok: r.ok, name: r.name.trim() };
}
else {
return r;
}
})
tt.deepEqual(rs, [
'TAP version 13',
'run success',
{ id: 1, ok: true, name: 'assert name'},
'tests 1',
'pass 1',
'ok'
])
tt.end()
})
test.stream.pipe(tc)
test("never run fail", function (t) {
t.equal(true, false)
t.end()
})
test("never run success", function (t) {
t.equal(true, true)
t.end()
})
test.only("run success", function (t) {
t.ok(true, "assert name")
t.end()
})
})
+19
-1

@@ -29,2 +29,3 @@ var createDefaultStream = require('./lib/default_stream');

var began = false;
var only = false;
var out = new Render();

@@ -41,3 +42,5 @@

out.close();
if (!code && !t._ok) process.exit(1);
if (!code && !t._ok && (!only || name === only)) {
process.exit(1);
}
});

@@ -57,2 +60,7 @@ }

if (only && name !== only) {
count--;
return;
}
if (running || pending.length) {

@@ -100,2 +108,12 @@ pending.push(run);

test.only = function (name) {
if (only) {
throw new Error("there can only be one only test");
}
only = name;
return test.apply(null, arguments);
};
test.stream = out;

@@ -102,0 +120,0 @@ return test;

+1
-1

@@ -106,3 +106,3 @@ var EventEmitter = require('events').EventEmitter;

actual : defined(extra.actual, opts.actual),
expected : defined(extra.expected, opts.expected),
expected : defined(extra.expected, opts.expected)
};

@@ -109,0 +109,0 @@ this._ok = Boolean(this._ok && ok);

{
"name" : "tape",
"version" : "0.2.0",
"version" : "0.2.1",
"description" : "tap-producing test harness for node and browsers",

@@ -5,0 +5,0 @@ "main" : "index.js",

Sorry, the diff of this file is not supported yet