Skip to content

Commit deab3fe

Browse files
chore(core) Document: add test checking pageContents empty string behavior (#2836)
Co-authored-by: Ben Burns <[email protected]>
1 parent e9dbac2 commit deab3fe

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { describe, expect, test } from "@jest/globals";
2+
import { Document } from "../document.js";
3+
4+
describe("Document", () => {
5+
test("Constructing a document with an empty sting", async () => {
6+
const doc = new Document({ pageContent: "" });
7+
expect(doc.pageContent).toEqual("");
8+
});
9+
10+
test("Constructing a document with an undefined at runtime", async () => {
11+
const pageContent = undefined as unknown as string;
12+
const doc = new Document({ pageContent });
13+
expect(doc.pageContent).toEqual("");
14+
});
15+
});

0 commit comments

Comments
 (0)