git ssb

2+

Dominic / ssb-client



Commit 618cfb143d0fc9dc508046d276fdeadb9b2963cf

update test for api changes

Paul Frazee committed on 3/6/2015, 8:18:35 PM
Parent: f6a643ca8049644a8aeacc3a498d60271c0015a9

Files changed

test/index.jschanged
test/index.jsView
@@ -6,21 +6,22 @@
66 tape('test api', function (t) {
77
88 var db = require('level-sublevel')(require('levelup')('/testdb', { db: require('memdown') }))
99 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'))
1111
1212 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) {
1419 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()
2425 })
2526 })
2627 })

Built with git-ssb-web