fix: make useServerAction accept void-returning actions and remove dead queryCount
Local Build and Deploy / deploy (push) Successful in 53s
Local Build and Deploy / deploy (push) Successful in 53s
- Type run()'s action param as Promise<unknown> and cast result (Biome strips void from unions) - Remove unused queryCount field increment in DbService (dead code) - Reformat theme-contrast test pair assertions
This commit is contained in:
1 parent
1908136071
commit
2455a4850e
4 files changed
+12
-835
No files matched your search
@@ -19,7 +19,6 @@ export class DbService {
|
||||
private readonly client: PrismaClient;
|
||||
private lastHealthCheck = 0;
|
||||
private healthCache: HealthStatus | null = null;
|
||||
private queryCount = 0;
|
||||
private readonly healthTtlMs = 10_000;
|
||||
|
||||
constructor() {
|
||||
@@ -106,7 +105,6 @@ export class DbService {
|
||||
}
|
||||
|
||||
async execute<T>(fn: (client: PrismaClient) => Promise<T>): Promise<T> {
|
||||
this.queryCount++;
|
||||
try {
|
||||
return await fn(this.client);
|
||||
} catch (cause) {
|
||||
|
||||
@@ -166,14 +166,14 @@ describe("derivePublicForegrounds", () => {
|
||||
for (const palette of [preset.light, preset.dark]) {
|
||||
const result = derivePublicForegrounds(palette);
|
||||
for (const name of required) {
|
||||
const pair = result.pairs.find(
|
||||
(candidate) => candidate.name === name,
|
||||
);
|
||||
expect(pair, `missing ${name}`).toBeDefined();
|
||||
expect(
|
||||
contrastRatio(pair!.foreground, pair!.background),
|
||||
name,
|
||||
).toBeGreaterThanOrEqual(4.5);
|
||||
const pair = result.pairs.find(
|
||||
(candidate) => candidate.name === name,
|
||||
);
|
||||
expect(pair, `missing ${name}`).toBeDefined();
|
||||
expect(
|
||||
contrastRatio(pair?.foreground, pair?.background),
|
||||
name,
|
||||
).toBeGreaterThanOrEqual(4.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user