From 5fe5f8a01325bc97383fc5985a5c83d563ca697a Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Tue, 4 Aug 2026 10:28:51 +0200 Subject: [PATCH] test(e2e): Fix type error in nextjs ai-error tests `value?.includes(...)` yields `boolean | undefined`, which widens to `Promise` in the async callback and is not assignable to `waitForError`'s `boolean | Promise`. Next 16.3 made `experimental.useTypeScriptCli` the default, and that path does not filter diagnostics in `*.test.ts` the way the previous TypeScript-API path did, so this pre-existing error now fails `next build`. Fixes #22973 Co-Authored-By: Claude Opus 5 (1M context) --- .../test-applications/nextjs-15/tests/ai-error.test.ts | 2 +- .../test-applications/nextjs-16/tests/ai-error.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/nextjs-15/tests/ai-error.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-15/tests/ai-error.test.ts index ccf999cfab34..7aed8bd3135a 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-15/tests/ai-error.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-15/tests/ai-error.test.ts @@ -16,7 +16,7 @@ test.fixme('should create AI spans with correct attributes and error linking', a ); const errorEventPromise = waitForError('nextjs-15', async errorEvent => { - return errorEvent.exception?.values?.[0]?.value?.includes('Tool call failed'); + return !!errorEvent.exception?.values?.[0]?.value?.includes('Tool call failed'); }); await page.goto('/ai-error-test'); diff --git a/dev-packages/e2e-tests/test-applications/nextjs-16/tests/ai-error.test.ts b/dev-packages/e2e-tests/test-applications/nextjs-16/tests/ai-error.test.ts index 59c8f8681253..07725170bc9e 100644 --- a/dev-packages/e2e-tests/test-applications/nextjs-16/tests/ai-error.test.ts +++ b/dev-packages/e2e-tests/test-applications/nextjs-16/tests/ai-error.test.ts @@ -16,7 +16,7 @@ test.fixme('should create AI spans with correct attributes and error linking', a ); const errorEventPromise = waitForError('nextjs-16', async errorEvent => { - return errorEvent.exception?.values?.[0]?.value?.includes('Tool call failed'); + return !!errorEvent.exception?.values?.[0]?.value?.includes('Tool call failed'); }); await page.goto('/ai-error-test');