Created
August 21, 2019 16:03
-
-
Save JhonatanHern/515de72ea103bf87e097ab5b12cbffef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
const tape = require('tape') | |
const { Diorama, tapeExecutor, backwardCompatibilityMiddleware } = require('@holochain/diorama') | |
process.on('unhandledRejection', error => { | |
// Will print "unhandledRejection err is not defined" | |
console.error('got unhandledRejection:', error); | |
}) | |
const dnaPath = path.join(__dirname, "../dist/backend.dna.json") | |
const dna = Diorama.dna(dnaPath, 'backend') | |
const diorama = new Diorama({ | |
instances: { | |
alice: dna, | |
bob: dna, | |
}, | |
bridges: [], | |
debugLog: false, | |
executor: tapeExecutor(tape), | |
middleware: backwardCompatibilityMiddleware, | |
}) | |
diorama.registerScenario("description of example test", async (s, /*t,*/ { alice }) => { | |
const res = alice.call("messaging", "reee", {s:'Example String'}) | |
// t.deepEqual(res, {Ok:'Example String'}) | |
}) | |
diorama.registerScenario("Can create an user", async (s, /*t,*/ { alice }) => { | |
const addr = alice.call("messaging", "create_user", { | |
"username":"JhonatanHern" | |
}) | |
// t.deepEqual({ Ok: 'QmVVDRffrS8gZXyCDmfB5X6MtcTWhsbeohWyTWrxEQoFZK' },addr) | |
}) | |
diorama.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment