Skip to content

Commit

Permalink
Repo.test: add test for initial value
Browse files Browse the repository at this point in the history
  • Loading branch information
HerbCaudill committed Jan 21, 2024
1 parent cec1990 commit d8dce05
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/automerge-repo/test/Repo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ describe("Repo", () => {
assert.equal(handle.isReady(), true)
})

it("can create a document with an initial value", async () => {
const { repo } = setup()
const handle = repo.create({ foo: "bar" })
await handle.doc()
assert.equal(handle.docSync().foo, "bar")
})

it("can find a document by url", () => {
const { repo } = setup()
const handle = repo.create<TestDoc>()
Expand Down

0 comments on commit d8dce05

Please sign in to comment.