test: improve test coverage (#6857)

This commit is contained in:
Joshua Chen 2022-03-06 17:55:21 +08:00 committed by GitHub
parent edb4d00096
commit f763ac13a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 435 additions and 220 deletions

View file

@ -60,9 +60,9 @@ export const DefaultSidebarItemsGenerator: SidebarItemsGenerator = async ({
const doc = findDoc(docId);
if (!doc) {
throw new Error(
`Can't find any doc with id=${docId}.\nAvailable doc ids:\n- ${Object.keys(
docsById,
).join('\n- ')}`,
`Can't find any doc with ID ${docId}.
Available doc IDs:
- ${Object.keys(docsById).join('\n- ')}`,
);
}
return doc;