Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
feross committed Jan 27, 2015
1 parent b2541ab commit f5302a9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/torrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ Torrent.prototype._onWire = function (wire) {

// When peer sends PORT, add them to the routing table
wire.on('port', function (port) {
debug('port message from ' + wire.remoteAddress)
debug('port %s message from %s', port, wire.remoteAddress)
// TODO: dht should support adding a node when you don't know the nodeId
// dht.addNode(wire.remoteAddress + ':' + port)
})
Expand Down
2 changes: 1 addition & 1 deletion test/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test('Command line: webtorrent info /path/to/file.torrent', function (t) {
t.deepEqual(data, JSON.parse(JSON.stringify(parsedTorrent, undefined, 2)))
})

cp.exec(CMD + ' info /bad/path', function (err, data) {
cp.exec(CMD + ' info /bad/path', function (err) {
t.ok(err instanceof Error)
})
})
Expand Down
3 changes: 2 additions & 1 deletion test/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ var leaves = fs.readFileSync(__dirname + '/torrents/leaves.torrent')
var leavesTorrent = parseTorrent(leaves)

test('ut_metadata transfer', function (t) {
t.plan(5)
t.plan(6)

var client1 = new WebTorrent({ dht: false, tracker: false })
var client2 = new WebTorrent({ dht: false, tracker: false })

client1.on('torrent', function (torrent) {
t.pass('client1 emits torrent event') // even though it started with metadata
t.ok(torrent.metadata, 'metadata exists')
})

// client1 starts with metadata from torrent file
Expand Down
4 changes: 2 additions & 2 deletions test/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ torrents.forEach(function (torrent) {
var length = 0
var pieces = 0

storage.pieces.forEach(function (piece, index) {
storage.pieces.forEach(function (piece) {
t.notOk(piece.verified)
length += piece.length

Expand All @@ -37,7 +37,7 @@ torrents.forEach(function (torrent) {
t.equal(length, parsedTorrent.length)
length = 0

storage.files.forEach(function (file, index) {
storage.files.forEach(function (file) {
t.notOk(file.done)
length += file.length
pieces += file.pieces.length
Expand Down

0 comments on commit f5302a9

Please sign in to comment.