Files: d9ab14281e683bbcd8f54b5cb7874edbbdd088a7 / tests / apiTests.js
525 bytesRaw
1 | const tape = require('tape') |
2 | const Hypervisor = require('../hypervisor.js') |
3 | const Message = require('../message.js') |
4 | |
5 | tape('send and reciving messages', async t => { |
6 | try { |
7 | const hypervisor = new Hypervisor() |
8 | const path = ['one', 'two', 'three'] |
9 | hypervisor.set(path, { |
10 | run: message => { |
11 | t.pass('got message') |
12 | t.end() |
13 | return {} |
14 | } |
15 | }) |
16 | hypervisor.send(new Message({ |
17 | to: path |
18 | })).catch(e => { |
19 | console.log(e) |
20 | }) |
21 | } catch (e) { |
22 | console.log(e) |
23 | } |
24 | }) |
25 |
Built with git-ssb-web