style: fix biome formatting
parent
73a9fdca2a
commit
499a3e3227
File diff suppressed because it is too large
Load Diff
|
|
@ -7,11 +7,7 @@ import { afterEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
import { setVerbose } from "./globals.js";
|
import { setVerbose } from "./globals.js";
|
||||||
import { logDebug, logError, logInfo, logSuccess, logWarn } from "./logger.js";
|
import { logDebug, logError, logInfo, logSuccess, logWarn } from "./logger.js";
|
||||||
import {
|
import { DEFAULT_LOG_DIR, resetLogger, setLoggerOverride } from "./logging.js";
|
||||||
DEFAULT_LOG_DIR,
|
|
||||||
resetLogger,
|
|
||||||
setLoggerOverride,
|
|
||||||
} from "./logging.js";
|
|
||||||
import type { RuntimeEnv } from "./runtime.js";
|
import type { RuntimeEnv } from "./runtime.js";
|
||||||
|
|
||||||
describe("logger helpers", () => {
|
describe("logger helpers", () => {
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,11 @@ function pruneOldRollingLogs(dir: string): void {
|
||||||
const cutoff = Date.now() - MAX_LOG_AGE_MS;
|
const cutoff = Date.now() - MAX_LOG_AGE_MS;
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
if (!entry.isFile()) continue;
|
if (!entry.isFile()) continue;
|
||||||
if (!entry.name.startsWith(`${LOG_PREFIX}-`) || !entry.name.endsWith(LOG_SUFFIX)) continue;
|
if (
|
||||||
|
!entry.name.startsWith(`${LOG_PREFIX}-`) ||
|
||||||
|
!entry.name.endsWith(LOG_SUFFIX)
|
||||||
|
)
|
||||||
|
continue;
|
||||||
const fullPath = path.join(dir, entry.name);
|
const fullPath = path.join(dir, entry.name);
|
||||||
try {
|
try {
|
||||||
const stat = fs.statSync(fullPath);
|
const stat = fs.statSync(fullPath);
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,9 @@ describe("media server", () => {
|
||||||
const server = await startMediaServer(0, 5_000);
|
const server = await startMediaServer(0, 5_000);
|
||||||
const port = (server.address() as AddressInfo).port;
|
const port = (server.address() as AddressInfo).port;
|
||||||
// URL-encoded "../" to bypass client-side path normalization
|
// URL-encoded "../" to bypass client-side path normalization
|
||||||
const res = await fetch(`http://localhost:${port}/media/%2e%2e%2fpackage.json`);
|
const res = await fetch(
|
||||||
|
`http://localhost:${port}/media/%2e%2e%2fpackage.json`,
|
||||||
|
);
|
||||||
expect(res.status).toBe(400);
|
expect(res.status).toBe(400);
|
||||||
expect(await res.text()).toBe("invalid path");
|
expect(await res.text()).toBe("invalid path");
|
||||||
await new Promise((r) => server.close(r));
|
await new Promise((r) => server.close(r));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue