fix(build): Improve warning message if menu’s page not found

This commit is contained in:
SamTolmay 2021-01-14 15:48:26 +02:00
parent 4cdf89182c
commit 7df576a268
2 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ async function buildMenu({ components, context }) {
await Promise.all(
missingPageWarnings.map(async (warning) => {
await context.logger.warn(
`Page ${warning.pageId} referenced in menu link ${warning.menuItemId} not found.`
`Page "${warning.pageId}" referenced in menu link "${warning.menuItemId}" not found.`
);
})
);

View File

@ -267,7 +267,7 @@ test('buildMenu page does not exist', async () => {
pages: [],
});
expect(mockLogWarn.mock.calls).toEqual([
['Page page_1 referenced in menu link menu_page_1 not found.'],
['Page "page_1" referenced in menu link "menu_page_1" not found.'],
]);
});
@ -343,8 +343,8 @@ test('buildMenu page does not exist, nested', async () => {
pages: [],
});
expect(mockLogWarn.mock.calls).toEqual([
['Page page_1 referenced in menu link menu_page_1 not found.'],
['Page page_2 referenced in menu link menu_page_2 not found.'],
['Page "page_1" referenced in menu link "menu_page_1" not found.'],
['Page "page_2" referenced in menu link "menu_page_2" not found.'],
]);
});