many fixes resulting from latest refactoring
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 5m50s

This commit is contained in:
2025-12-09 13:15:33 -08:00
parent dbdee8e456
commit a490ab6480

View File

@@ -9,7 +9,8 @@ describe('Client Logger', () => {
});
it('logger.info calls console.log with [INFO] prefix', () => {
const spy = vi.spyOn(console, 'log').mockImplementation(() => {});
// Access globalThis.console to ensure we spy on the environment's actual console
const spy = vi.spyOn(globalThis.console, 'log').mockImplementation(() => {});
const message = 'test info';
const data = { foo: 'bar' };
@@ -20,7 +21,7 @@ describe('Client Logger', () => {
});
it('logger.warn calls console.warn with [WARN] prefix', () => {
const spy = vi.spyOn(console, 'warn').mockImplementation(() => {});
const spy = vi.spyOn(globalThis.console, 'warn').mockImplementation(() => {});
const message = 'test warn';
logger.warn(message);
@@ -30,7 +31,7 @@ describe('Client Logger', () => {
});
it('logger.error calls console.error with [ERROR] prefix', () => {
const spy = vi.spyOn(console, 'error').mockImplementation(() => {});
const spy = vi.spyOn(globalThis.console, 'error').mockImplementation(() => {});
const message = 'test error';
const err = new Error('fail');
@@ -41,7 +42,7 @@ describe('Client Logger', () => {
});
it('logger.debug calls console.debug with [DEBUG] prefix', () => {
const spy = vi.spyOn(console, 'debug').mockImplementation(() => {});
const spy = vi.spyOn(globalThis.console, 'debug').mockImplementation(() => {});
const message = 'test debug';
logger.debug(message);