Commit 618cfb143d0fc9dc508046d276fdeadb9b2963cf
update test for api changes
Paul Frazee committed on 3/6/2015, 8:18:35 PMParent: f6a643ca8049644a8aeacc3a498d60271c0015a9
Files changed
test/index.js | changed |
test/index.js | ||
---|---|---|
@@ -6,21 +6,22 @@ | ||
6 | 6 … | tape('test api', function (t) { |
7 | 7 … | |
8 | 8 … | var db = require('level-sublevel')(require('levelup')('/testdb', { db: require('memdown') })) |
9 | 9 … | var ssb = require('secure-scuttlebutt')(db, require('secure-scuttlebutt/defaults')) |
10 | - var server = scuttlebot({ port: 45451, host: 'localhost' }, ssb, ssb.createFeed()) | |
10 … | + var server = scuttlebot({ port: 45451, host: 'localhost' }, ssb, ssb.createFeed()).use(require('scuttlebot/plugins/logging')) | |
11 | 11 … | |
12 | 12 … | var keys = ssbkeys.generate() |
13 | - var client = ssbclient(keys, {port: 45451, host: 'localhost'}, function (err, authed) { | |
13 … | + var client = ssbclient(keys) | |
14 … | + client.connect({ port: 45451, host: 'localhost' }, function (err) { | |
15 … | + if (err) | |
16 … | + throw err | |
17 … | + }) | |
18 … | + client.publish({type: 'post', text: 'hello'}, function (err, data) { | |
14 | 19 … | if(err) throw err |
15 | - t.ok(authed.granted) | |
16 | - client.publish({type: 'post', text: 'hello'}, function (err, data) { | |
17 | - if(err) throw err | |
18 | - t.equal(data.value.content.text, 'hello') | |
19 | - console.log(data) | |
20 | - client.close(function() { | |
21 | - server.close() | |
22 | - t.end() | |
23 | - }) | |
20 … | + t.equal(data.value.content.text, 'hello') | |
21 … | + console.log(data) | |
22 … | + client.close(function() { | |
23 … | + server.close() | |
24 … | + t.end() | |
24 | 25 … | }) |
25 | 26 … | }) |
26 | 27 … | }) |
Built with git-ssb-web