Skip to content

Commit 9085510

Browse files
nperez0111claude
andcommitted
fix: unmount editor in ForkYDoc tests to prevent unhandled errors
ProseMirror's DOMObserver timeout fires after jsdom teardown, causing "document is not defined" ReferenceError. Adding editor.unmount() at the end of each test ensures proper cleanup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 73a275c commit 9085510

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/core/src/extensions/Collaboration/ForkYDoc.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ it("can fork a document", async () => {
5252
await expect(editor.document).toMatchFileSnapshot(
5353
"__snapshots__/fork-yjs-snap-editor-forked.json",
5454
);
55+
56+
editor.unmount();
5557
});
5658

5759
it("can merge a document", async () => {
@@ -108,6 +110,8 @@ it("can merge a document", async () => {
108110
await expect(editor.document).toMatchFileSnapshot(
109111
"__snapshots__/fork-yjs-snap-editor.json",
110112
);
113+
114+
editor.unmount();
111115
});
112116

113117
it("can fork an keep the changes to the original document", async () => {
@@ -164,4 +168,6 @@ it("can fork an keep the changes to the original document", async () => {
164168
await expect(editor.document).toMatchFileSnapshot(
165169
"__snapshots__/fork-yjs-snap-editor-forked.json",
166170
);
171+
172+
editor.unmount();
167173
});

0 commit comments

Comments
 (0)