mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-01 02:15:19 +00:00
(test): add local Obsidian E2E suite
This commit is contained in:
@@ -228,10 +228,12 @@ async function storeCustomisationFile(cliBinary: string, env: NodeJS.ProcessEnv,
|
||||
"const result=await addOn.storeCustomizationFiles(path,term);",
|
||||
"const rows=(await core.localDatabase.allDocsRaw({include_docs:true})).rows;",
|
||||
"const entries=rows.map((row)=>row.doc).filter((doc)=>doc?.path?.startsWith('ix:')).map((doc)=>doc.path);",
|
||||
"if(!result){",
|
||||
"const filename=path.split('/').pop();",
|
||||
"const existing=entries.some((entry)=>entry.startsWith(`ix:${term}/${category}/`)&&entry.endsWith(`%${filename}`));",
|
||||
"if(!result&&!existing){",
|
||||
" throw new Error(`Could not store Customisation Sync file: path=${path}; term=${term}; category=${category}; stat=${JSON.stringify(stat)}; result=${JSON.stringify(result)}; entries=${JSON.stringify(entries)}`);",
|
||||
"}",
|
||||
"return JSON.stringify({ok:true,path,term,category,entries});",
|
||||
"return JSON.stringify({ok:true,path,term,category,result:!!result,existing,entries});",
|
||||
"})()",
|
||||
].join(""),
|
||||
env
|
||||
|
||||
Reference in New Issue
Block a user