Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/core/src/core-server/presets/common-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ')}
Expand Down
10 changes: 5 additions & 5 deletions code/core/src/core-server/presets/favicon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const createOptions = (locations: string[]): Parameters<typeof m.favicon>[1] =>
vi.mock('storybook/internal/node-logger', () => {
return {
logger: {
warn: vi.fn(() => {}),
debug: vi.fn(() => {}),
},
};
});
Expand Down Expand Up @@ -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))) {
Expand All @@ -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) => {
Expand All @@ -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'));
});