Skip to content

Commit cbff799

Browse files
committed
test: type the counting proxy's findOne, drop an any-erased find options
Claude-Session: https://claude.ai/code/session_011TdZ8GjixNZFLz1xJD9zzK Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8149493 commit cbff799

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎packages/plugins/plugin-approvals/src/approval-notification-keyed-text.integration.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ describe('#24978 — end to end: a real messaging service renders each approver\
309309
const inboxOf = async (userId: string) => {
310310
const rows = (await engine.find('sys_inbox_message', {
311311
where: { user_id: userId }, fields: ['topic', 'title', 'body_md'],
312-
}, { context: SYSTEM } as any)) as any[];
312+
}, { context: SYSTEM })) as any[];
313313
return rows.map((r) => ({ topic: r.topic, title: r.title, body: r.body_md }));
314314
};
315315

‎packages/services/service-messaging/src/keyed-notification-text.integration.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,11 @@ function countingData(ql: ObjectQL) {
157157
const data = new Proxy(ql as any, {
158158
get(target, prop, receiver) {
159159
if (prop === 'findOne') {
160-
return async (object: string, query: any, options?: any) => {
160+
return async (...args: Parameters<ObjectQL['findOne']>) => {
161+
const [object, query] = args;
161162
const fields: unknown = query?.fields;
162163
if (object === 'sys_user' && Array.isArray(fields) && fields.length === 1 && fields[0] === 'locale') localeReads += 1;
163-
return target.findOne(object, query, options);
164+
return target.findOne(...args);
164165
};
165166
}
166167
const value = Reflect.get(target, prop, receiver);

0 commit comments

Comments
 (0)