//global variable. Is this a good way in Diorama?
var addr1 = "some_addr";
diorama.registerScenario("create 123", async (s, t, {alice}) => {
let res1 = await alice.call("my_app", "create_my_entity", {"name": "broker1"});
t.deepEqual(res1, {Ok: addr1}, "create 123'");
t.ok(res1, res1.Ok !== undefined && res1.Err === undefined);
// All ok
})
In the other test I try to retrieve an entity I created previously:
@alx normally we try very hard to avoid anything at all persisting across tests
some testing frameworks even randomise the ordering of tests to help detect violations of this principle
the idea is that we want to be able to (ideally deterministically) build up everything we need in order to test a specific set of inputs and corresponding outputs
if you have some specific test fixtures you need then you could write a function that returns and/or builds what you need in the state?