So I was trying to make my test work in our project but then it seems like the hdk:get_entry call is not working properly. So, just to be sure, I reinstantiated a new hc project and tried to run the test there without altering anything on a freshly created zome which has a get_my_entry zome call and it still fails.
So here is where the test is actually failing
not ok 1 should be equivalent
---
operator: deepEqual
expected: |-
{ Ok: { App: [ 'my_entry', '{"content":"sample content"}' ] } }
actual: |-
{ Ok: null }
stack: |-
Error: should be equivalent
at Test.assert [as _assert] (/Users/lc/Desktop/example/test/node_modules/tape/lib/test.js:228:54)
at Test.bound [as _assert] (/Users/lc/Desktop/example/test/node_modules/tape/lib/test.js:80:32)
at Test.tapeDeepEqual (/Users/lc/Desktop/example/test/node_modules/tape/lib/test.js:426:10)
at Test.bound [as deepEqual] (/Users/lc/Desktop/example/test/node_modules/tape/lib/test.js:80:32)
at /Users/lc/Desktop/example/test/index.js:59:5
at processTicksAndRejections (internal/process/task_queues.js:93:5)
...
here’s my js
const path = require('path')
const { Orchestrator, Config, combine, singleConductor, localOnly, tapeExecutor } = require('@holochain/tryorama')
process.on('unhandledRejection', error => {
console.error('got unhandledRejection:', error);
});
const dnaPath = path.join(__dirname, "../dist/example.dna.json")
const orchestrator = new Orchestrator({
middleware: combine(
tapeExecutor(require('tape')),
localOnly,
singleConductor,
),
})
const dna = Config.dna(dnaPath, 'scaffold-test')
const conductorConfig = Config.gen(
{myInstanceName: dna},
{
network: {
type: "sim2h",
sim2h_url: "ws://localhost:8888"
},
}
)
orchestrator.registerScenario("description of example test", async (s, t) => {
const {alice, bob} = await s.players({alice: conductorConfig, bob: conductorConfig}, true)
const addr = await alice.call("myInstanceName", "hello", "create_my_entry", {"entry" : {"content":"sample content"}})
await s.consistency()
const result = await bob.call("myInstanceName", "hello", "get_my_entry", {"address": addr.Ok})
t.deepEqual(result, { Ok: { App: [ 'my_entry', '{"content":"sample content"}' ] } })
})
orchestrator.run()
It seems like the get_entry call is returning a null but then when i tried to call the get_entry call from Insomnia it had no problem in retrieving the entry I just made. Sorry in advance if this is such a beginner question. I feel like I’m missing something very obvious here.
Would appreciate anyone’s help.
Thanks!