mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-23 05:24:51 +00:00
14 lines
413 B
TypeScript
14 lines
413 B
TypeScript
|
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");
|
||
|
})
|