Skip to content

Commit a76b115

Browse files
committed
test(driver-memory): type the where twin instead of erasing the query to any
Claude-Session: https://claude.ai/code/session_01Bvd69VPa6puiNzzPUroDBx Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9e5c309 commit a76b115

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/drivers/driver-memory/src/memory-temporal-storage-form.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import { describe, it, expect, beforeAll } from 'vitest';
2424
import { temporalStorageForm } from '@objectstack/core';
25+
import type { FilterCondition } from '@objectstack/spec/data';
2526
import { coerceTemporalValue } from './memory-temporal.js';
2627
import { InMemoryDriver } from './memory-driver.js';
2728

@@ -73,7 +74,7 @@ const ROWS = [
7374
];
7475

7576
/** The #20176 card's rows, as a `where`, with the count this driver answers. */
76-
const CARD_WHERE_TWINS: ReadonlyArray<readonly [string, () => Record<string, unknown>, number]> = [
77+
const CARD_WHERE_TWINS: ReadonlyArray<readonly [string, () => FilterCondition, number]> = [
7778
['row 1 — an ISO instant $gte on a date field', () => ({ placed_on: { $gte: '2026-02-01T00:00:00.000Z' } }), 3],
7879
['row 2 — an ISO instant $eq on a date field', () => ({ placed_on: { $eq: '2026-02-01T00:00:00.000Z' } }), 2],
7980
['row 3 — a bare day as the $lte of a datetime', () => ({ opened_at: { $lte: '2026-02-01' } }), 3],
@@ -101,7 +102,7 @@ describe('[#20176] the where twins of the card\'s rows, on this driver', () => {
101102

102103
for (const [name, where, expected] of CARD_WHERE_TWINS) {
103104
it(`${name}: ${expected} of 6`, async () => {
104-
const rows = await driver.find(OBJECT, { where: where() } as any);
105+
const rows = await driver.find(OBJECT, { where: where() });
105106
expect(rows).toHaveLength(expected);
106107
});
107108
}

0 commit comments

Comments
 (0)