@holochain/diorama
TypeScript icon, indicating that this package has built-in type declarations

0.3.0-rc.2 • Public • Published

diorama

The first Holochain test orchestrator.

Basic usage

const {Diorama} = require('@holochain/diorama')
const dnaBlog = Diorama.dna('path/to/blog.dna.json', 'blog')
const dnaComments = Diorama.dna('path/to/comments.dna.json', 'comments')

const diorama = new Diorama({
  instances: {
    aliceBlog: dnaBlog,
    aliceComments: dnaComments,
    bobBlog: dnaBlog,
    bobComments: dnaComments
  },
  bridges: [
    Diorama.bridge('handle', aliceBlog, aliceComments),
    Diorama.bridge('handle', bobBlog, bobComments),
  ]
})

diorama.registerScenario('a test', async (s, {aliceBlog, bobBlog}) => {
    await aliceBlog.call('blog', 'create_post', {
        content: 'holo wurld'
    })
    await s.consistent()
    const posts = await bobBlog.call('blog', 'list_posts')
    // write some assertions
})

diorama.run()

Stay tuned

Much more documention to come!

Readme

Keywords

Package Sidebar

Install

npm i @holochain/diorama

Weekly Downloads

7

Version

0.3.0-rc.2

License

GPL-3

Unpacked Size

64.4 kB

Total Files

40

Last publish

Collaborators

  • mrruby
  • thetasinner
  • matthme
  • jost-s
  • guillem.cordoba
  • neonphog
  • connoropolous
  • lucksus
  • zippy314
  • thedavidmeister
  • maackle
  • peeech
  • zo-el
  • brisebom