mirror of
https://github.com/margrop/wrong-notebook.git
synced 2026-12-05 11:20:09 +08:00
test: Word 导出断言只统计数据文件,忽略 zip 目录条目
This commit is contained in:
@@ -200,7 +200,8 @@ describe("buildDocxParagraphs", () => {
|
||||
];
|
||||
const blob = await buildQuestionsDocx(withFigureOnly, { includeImages: false });
|
||||
const entries = unzipSync(new Uint8Array(await blob.arrayBuffer()));
|
||||
const mediaFiles = Object.keys(entries).filter((n) => n.startsWith("word/media/"));
|
||||
// 解压结果里有 "word/media/" 目录条目,只统计真正的图片文件
|
||||
const mediaFiles = Object.keys(entries).filter((n) => n.startsWith("word/media/") && !n.endsWith("/"));
|
||||
expect(mediaFiles).toHaveLength(1);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user