From fddafe6ad898bf236f6338fd6ce74c07477e890a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mino=20Rem?= <29999+remino@users.noreply.github.com> Date: Sun, 8 Mar 2026 20:50:23 +0900 Subject: [PATCH] Show multiple favicons warning as debug message: A logger.warn() message was displayed before. Changing to logger.debug(). --- code/core/src/core-server/presets/common-preset.ts | 2 +- code/core/src/core-server/presets/favicon.test.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/core/src/core-server/presets/common-preset.ts b/code/core/src/core-server/presets/common-preset.ts index 22387945616a..f1004214dc8b 100644 --- a/code/core/src/core-server/presets/common-preset.ts +++ b/code/core/src/core-server/presets/common-preset.ts @@ -93,7 +93,7 @@ export const favicon = async ( .reduce((l1, l2) => l1.concat(l2), []); if (faviconPaths.length > 1) { - logger.warn(dedent` + logger.debug(dedent` Looks like multiple favicons were detected. Using the first one. ${faviconPaths.join(', ')} diff --git a/code/core/src/core-server/presets/favicon.test.ts b/code/core/src/core-server/presets/favicon.test.ts index e6be6ebb054f..b35a99d6f602 100644 --- a/code/core/src/core-server/presets/favicon.test.ts +++ b/code/core/src/core-server/presets/favicon.test.ts @@ -49,7 +49,7 @@ const createOptions = (locations: string[]): Parameters[1] => vi.mock('storybook/internal/node-logger', () => { return { logger: { - warn: vi.fn(() => {}), + debug: vi.fn(() => {}), }, }; }); @@ -125,7 +125,7 @@ it('with staticDirs containing a single favicon.svg should return the found favi ); }); -it('with staticDirs containing a multiple favicons should return the first favicon and warn', async () => { +it('with staticDirs containing a multiple favicons should return the first favicon and show a debug message', async () => { const location = 'static'; existsSyncMock.mockImplementation((p) => { if (normalize(String(p)) === normalize(createPath(location))) { @@ -145,10 +145,10 @@ it('with staticDirs containing a multiple favicons should return the first favic normalize(createPath(location, 'favicon.svg')) ); - expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining('multiple favicons')); + expect(logger.debug).toHaveBeenCalledWith(expect.stringContaining('multiple favicons')); }); -it('with multiple staticDirs containing a multiple favicons should return the first favicon and warn', async () => { +it('with multiple staticDirs containing a multiple favicons should return the first favicon and show a debug message', async () => { const locationA = 'static-a'; const locationB = 'static-b'; existsSyncMock.mockImplementation((p) => { @@ -172,5 +172,5 @@ it('with multiple staticDirs containing a multiple favicons should return the fi normalize(createPath(locationA, 'favicon.ico')) ); - expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining('multiple favicons')); + expect(logger.debug).toHaveBeenCalledWith(expect.stringContaining('multiple favicons')); });