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