Files: 5e25721cf49edb99a5a6c9c1c02a43a255e49a2f / test / index.js
718 bytesRaw
1 | var tape = require('tape') |
2 | var ssbKeys = require('ssb-keys') |
3 | var ssbServer = require('scuttlebot') |
4 | .use(require('scuttlebot/plugins/master')) |
5 | |
6 | var ssbClient = require('../') |
7 | |
8 | var keys = ssbKeys.generate() |
9 | var server = ssbServer({ |
10 | port: 45451, timeout: 2001, |
11 | temp: 'connect', |
12 | host: 'localhost', |
13 | master: keys.id, |
14 | keys: keys |
15 | }) |
16 | |
17 | tape('connect', function (t) { |
18 | |
19 | ssbClient(keys, { port: 45451, manifest: server.manifest() }, function (err, client) { |
20 | if (err) throw err |
21 | |
22 | client.whoami(function (err, info) { |
23 | if (err) throw err |
24 | |
25 | console.log('whoami', info) |
26 | t.equal(info.id, keys.id) |
27 | t.end() |
28 | client.close(true) |
29 | server.close(true) |
30 | process.exit(0) |
31 | }) |
32 | }) |
33 | |
34 | }) |
35 |
Built with git-ssb-web