tests/index.jsView |
---|
196 | 196 … | |
197 | 197 … | t.equals(runs, 3, 'the number of run should be 3') |
198 | 198 … | const nonce = await hypervisor.graph.get(root.state, 'ports/first/link/nonce/0') |
199 | 199 … | t.equals(nonce, 3, 'should have the correct nonce') |
| 200 … | + |
| 201 … | + await hypervisor.graph.tree(root.state, Infinity) |
200 | 202 … | }) |
201 | 203 … | |
202 | 204 … | tape('traps', async t => { |
203 | 205 … | t.plan(1) |
228 | 230 … | } |
229 | 231 … | }, 'should revert the state') |
230 | 232 … | }) |
231 | 233 … | |
232 | | - tape('invalid port referances', async t => { |
233 | | - t.plan(2) |
234 | | - class Root extends BaseContainer { |
235 | | - async run (m) { |
236 | | - const port = this.kernel.ports.create('root') |
237 | | - this.kernel.ports.bind(port, 'three') |
238 | | - this.kernel.ports.unbind('three') |
239 | | - try { |
240 | | - await this.kernel.send(port, this.kernel.createMessage()) |
241 | | - } catch (e) { |
242 | | - t.pass() |
243 | | - } |
244 | | - } |
245 | | - } |
246 | | - |
247 | | - const hypervisor = new Hypervisor(node.dag) |
248 | | - |
249 | | - hypervisor.registerContainer('root', Root) |
250 | | - const root = await hypervisor.createInstance('root') |
251 | | - await root.run() |
252 | | - |
253 | | - t.deepEquals(root.state, { |
254 | | - '/': { |
255 | | - nonce: [1], |
256 | | - ports: {} |
257 | | - } |
258 | | - }) |
259 | | - }) |
260 | | - |
261 | 234 … | tape('message should arrive in the correct oder if sent in order', async t => { |
262 | 235 … | t.plan(2) |
263 | 236 … | |
264 | 237 … | class Root extends BaseContainer { |