From 0f27cc447d25367617696d883b803acb9b095078 Mon Sep 17 00:00:00 2001 From: Andrei Borza Date: Fri, 4 Sep 2026 15:51:02 +0200 Subject: [PATCH] test(e2e): Unroll the two-query loop in the create-remix-app-v2 db spec A loop over two literals reads worse than two assertions. --- .../create-remix-app-v2/tests/db.test.ts | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts index 2fae830957cd..68bff2c21cd3 100644 --- a/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/create-remix-app-v2/tests/db.test.ts @@ -53,22 +53,22 @@ test.describe('orchestrion DB instrumentation', () => { // With span streaming the span name is the low-cardinality query summary; the statement // stays in `db.query.text`. - for (const query of ['SELECT 1 + 1 AS solution', 'SELECT NOW()']) { - expect(mysqlSpans).toContainEqual( - expect.objectContaining({ - name: 'SELECT', - status: 'ok', - attributes: expect.objectContaining({ - 'sentry.origin': { value: 'auto.db.mysql', type: 'string' }, - 'db.system.name': { value: 'mysql', type: 'string' }, - 'db.query.text': { value: query, type: 'string' }, - 'db.user': { value: 'root', type: 'string' }, - 'db.connection_string': { value: expect.any(String), type: 'string' }, - 'server.address': { value: expect.any(String), type: 'string' }, - 'server.port': { value: 3306, type: 'integer' }, - }), + const expectedQuerySpan = (query: string) => + expect.objectContaining({ + name: 'SELECT', + status: 'ok', + attributes: expect.objectContaining({ + 'sentry.origin': { value: 'auto.db.mysql', type: 'string' }, + 'db.system.name': { value: 'mysql', type: 'string' }, + 'db.query.text': { value: query, type: 'string' }, + 'db.user': { value: 'root', type: 'string' }, + 'db.connection_string': { value: expect.any(String), type: 'string' }, + 'server.address': { value: expect.any(String), type: 'string' }, + 'server.port': { value: 3306, type: 'integer' }, }), - ); - } + }); + + expect(mysqlSpans).toContainEqual(expectedQuerySpan('SELECT 1 + 1 AS solution')); + expect(mysqlSpans).toContainEqual(expectedQuerySpan('SELECT NOW()')); }); });