fix(logger): don't color when running tests

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2552>
environments/review-docs-renov-dx7eod/deployments/18277
Kasper Seweryn 2023-08-14 15:52:54 +02:00 zatwierdzone przez Marge
rodzic 78be3d8feb
commit fc979983ca
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -52,6 +52,9 @@ const getFile = () => {
// NOTE: We're pushing all logs to the end of the event loop
const createLoggerFn = (level: LogLevel) => {
// NOTE: We don't want to handle logs ourselves in tests
if (import.meta.env.VITEST) return console[level]
return (...args: any[]) => {
const timestamp = new Date().toUTCString()
const { method, file, lineNo } = getFile()