Hello!
I’m just getting started with yjs and running into issues trying to write a Jasmin test with yjs code inspired in the README.md:
const doc = new Y.Doc()
const data = doc.getMap("data")
data.set("generator", "")
data.set("generator", "something")
expect(data.get("generator")).toBe("something")
const update = Y.encodeStateAsUpdate(doc)
const doc2 = new Y.Doc()
Y.applyUpdate(doc2, update)
const data2 = doc2.getMap("data")
expect(data2.get("generator")).toBe("something")
The second expect call fails intermittently saying that the data2.get("generator")
returns undefined instead of returning "something"
.
Any ideas?