test(server/share): implement basic shaca mocking with content

This commit is contained in:
Elian Doran
2025-09-28 14:40:30 +03:00
parent 804fc72ed8
commit a393584a2a
3 changed files with 108 additions and 13 deletions

View File

@@ -16,7 +16,7 @@ export interface Result {
isEmpty?: boolean;
}
function getContent(note: SNote) {
export function getContent(note: SNote) {
if (note.isProtected) {
return {
header: "",
@@ -65,7 +65,7 @@ function renderIndex(result: Result) {
result.content += "</ul>";
}
function renderText(result: Result, note: SNote) {
export function renderText(result: Result, note: SNote) {
const document = new JSDOM(result.content || "").window.document;
// Process include notes.