Skip to content

Commit 3784be1

Browse files
committed
test(drivers): type the member keyset walk's find options instead of casting them
1 parent d0d4c7d commit 3784be1

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎packages/drivers/driver-memory/src/memory-member-keyset-walk-conformance.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe("InMemoryDriver — a keyset walk by id visits every member once, in th
6363
: { organization_id: ORG, id: { $gt: after } };
6464
const page: Array<Record<string, unknown>> = await driver.find(
6565
TABLE,
66-
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] } as any,
66+
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] },
6767
);
6868
reads += 1;
6969
// A driver that ignores the cursor would page forever: fail instead of hanging.
@@ -79,7 +79,7 @@ describe("InMemoryDriver — a keyset walk by id visits every member once, in th
7979
const ordered = async () => {
8080
const rows: Array<Record<string, unknown>> = await driver.find(
8181
TABLE,
82-
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] } as any,
82+
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] },
8383
);
8484
return rows.map((r) => String(r.id));
8585
};

‎packages/drivers/driver-mongodb/src/mongodb-member-keyset-walk-conformance.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe.skipIf(!sharedMongod)("driver-mongodb — a keyset walk by id visits ev
7676
: { organization_id: ORG, id: { $gt: after } };
7777
const page: Array<Record<string, unknown>> = await driver.find(
7878
TABLE,
79-
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] } as any,
79+
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] },
8080
);
8181
reads += 1;
8282
// A driver that ignores the cursor would page forever: fail instead of hanging.
@@ -92,7 +92,7 @@ describe.skipIf(!sharedMongod)("driver-mongodb — a keyset walk by id visits ev
9292
const ordered = async () => {
9393
const rows: Array<Record<string, unknown>> = await driver.find(
9494
TABLE,
95-
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] } as any,
95+
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] },
9696
);
9797
return rows.map((r) => String(r.id));
9898
};

‎packages/drivers/driver-sql/src/sql-driver-member-keyset-walk-conformance.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function declareWalk(cell: DialectCell): void {
9696
: { organization_id: ORG, id: { $gt: after } };
9797
const page: Array<Record<string, unknown>> = await driver.find(
9898
TABLE,
99-
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] } as any,
99+
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] },
100100
READ_OPTIONS,
101101
);
102102
reads += 1;
@@ -113,7 +113,7 @@ function declareWalk(cell: DialectCell): void {
113113
const ordered = async () => {
114114
const rows: Array<Record<string, unknown>> = await driver.find(
115115
TABLE,
116-
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] } as any,
116+
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] },
117117
READ_OPTIONS,
118118
);
119119
return rows.map((r) => String(r.id));

‎packages/drivers/driver-sqlite-wasm/src/sqlite-wasm-member-keyset-walk-conformance.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe("SqliteWasmDriver — a keyset walk by id visits every member once, in
7171
: { organization_id: ORG, id: { $gt: after } };
7272
const page: Array<Record<string, unknown>> = await driver.find(
7373
TABLE,
74-
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] } as any,
74+
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] },
7575
READ_OPTIONS,
7676
);
7777
reads += 1;
@@ -88,7 +88,7 @@ describe("SqliteWasmDriver — a keyset walk by id visits every member once, in
8888
const ordered = async () => {
8989
const rows: Array<Record<string, unknown>> = await driver.find(
9090
TABLE,
91-
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] } as any,
91+
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] },
9292
READ_OPTIONS,
9393
);
9494
return rows.map((r) => String(r.id));

‎packages/drivers/driver-turso/src/turso-member-keyset-walk-conformance.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe("TursoDriver (local mode) — a keyset walk by id visits every member o
7171
: { organization_id: ORG, id: { $gt: after } };
7272
const page: Array<Record<string, unknown>> = await driver.find(
7373
TABLE,
74-
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] } as any,
74+
{ where, orderBy: [{ field: 'id', order: 'asc' }], limit: pageSize, fields: ['id', 'user_id'] },
7575
READ_OPTIONS,
7676
);
7777
reads += 1;
@@ -88,7 +88,7 @@ describe("TursoDriver (local mode) — a keyset walk by id visits every member o
8888
const ordered = async () => {
8989
const rows: Array<Record<string, unknown>> = await driver.find(
9090
TABLE,
91-
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] } as any,
91+
{ where: { organization_id: ORG }, orderBy: [{ field: 'id', order: 'asc' }], fields: ['id', 'user_id'] },
9292
READ_OPTIONS,
9393
);
9494
return rows.map((r) => String(r.id));

0 commit comments

Comments
 (0)