We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a55977 commit eef5fd6Copy full SHA for eef5fd6
1 file changed
tests/e2e/orm/client-api/diagnostics.test.ts
@@ -147,6 +147,25 @@ describe('Client $diagnostics tests', () => {
147
}
148
});
149
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
169
it('keeps the slowest queries when limit is exceeded', async () => {
170
const maxRecords = 2;
171
const client = await createTestClient(schema, {
0 commit comments