git ssb

0+

wanderer🌟 / js-primea-hypervisor



Tree: d9ab14281e683bbcd8f54b5cb7874edbbdd088a7

Files: d9ab14281e683bbcd8f54b5cb7874edbbdd088a7 / tests / apiTests.js

525 bytesRaw
1const tape = require('tape')
2const Hypervisor = require('../hypervisor.js')
3const Message = require('../message.js')
4
5tape('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