loro/loro-js/deno/test.ts

14 lines
413 B
TypeScript
Raw Normal View History

2024-04-12 09:33:28 +00:00
import { Loro } from "./mod.ts";
import { expect } from 'npm:expect'
Deno.test("test", () => {
const doc = new Loro();
const text = doc.getText("text");
text.insert(0, "123")
expect(text.toString()).toEqual("123");
text.insert(0, "123")
expect(text.toString()).toEqual("123123");
const docB = Loro.fromSnapshot(doc.exportSnapshot());
expect(docB.getText('text').toString()).toEqual("123123");
})