Skip to content

Commit eef5fd6

Browse files
committed
improve test
1 parent 5a55977 commit eef5fd6

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

tests/e2e/orm/client-api/diagnostics.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,25 @@ describe('Client $diagnostics tests', () => {
147147
}
148148
});
149149

150+
it('accepts Infinity as slowQueryMaxRecords', async () => {
151+
const client = await createTestClient(schema, {
152+
diagnostics: {
153+
slowQueryThresholdMs: 0,
154+
slowQueryMaxRecords: Infinity,
155+
},
156+
});
157+
try {
158+
for (let i = 0; i < 5; i++) {
159+
await client.user.create({ data: { email: `u${i}@test.com` } });
160+
}
161+
162+
const diagnostics = await client.$diagnostics();
163+
expect(diagnostics.slowQueries.length).toBe(5);
164+
} finally {
165+
await client.$disconnect();
166+
}
167+
});
168+
150169
it('keeps the slowest queries when limit is exceeded', async () => {
151170
const maxRecords = 2;
152171
const client = await createTestClient(schema, {

0 commit comments

Comments
 (0)