Add Prettier and ESLint tooling (Refs #77)

This commit is contained in:
2026-10-09 15:56:13 -04:00
parent 8ed059b8d3
commit 16469e2d43
711 changed files with 99737 additions and 28286 deletions
+12 -3
View File
@@ -3,8 +3,14 @@ import { newFixture, type Fixture } from '../helpers/fixture.js';
import { parseMetricsQuery } from '../../src/lib/metrics.js';
let fixture: Fixture;
beforeEach(async () => { vi.resetModules(); fixture = await newFixture([]); });
afterEach(async () => { vi.restoreAllMocks(); await fixture.cleanup(); });
beforeEach(async () => {
vi.resetModules();
fixture = await newFixture([]);
});
afterEach(async () => {
vi.restoreAllMocks();
await fixture.cleanup();
});
it('runs reports off the request thread and invalidates cached history after writes', async () => {
const { db } = await import('../../src/lib/server/db/index.js');
@@ -16,7 +22,10 @@ it('runs reports off the request thread and invalidates cached history after wri
recordMetrics([sample], now - 30_000);
const query = parseMetricsQuery(new URLSearchParams('days=1'));
const first = metricsReport(query);
const winner = await Promise.race([first.then(() => 'report'), new Promise<string>(resolve => setTimeout(() => resolve('timer'), 0))]);
const winner = await Promise.race([
first.then(() => 'report'),
new Promise<string>((resolve) => setTimeout(() => resolve('timer'), 0))
]);
expect(winner).toBe('timer');
expect(await first).toEqual(readMetrics(query, now));
expect(await metricsReport(query)).toEqual(await first);