From 9421f4a3549873590a7bd4e9c152142745b89c9f Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 13 Aug 2026 11:48:50 +0530 Subject: [PATCH] test(sites): drop the Next.js exception from the output invariant Skipping Next.js by name hardcoded one framework into a rule meant to hold for all of them, and would need editing the next time a framework exports a static site to its own root. Next.js is not really an exception. ./out is a single-segment build root, not a directory inside the ssr build, so the rule never applied to it. Guard on that instead: only a nested static directory names a folder within the build and has to sit under the ssr output. Still fails on main on nuxt and tanstack-start. --- tests/unit/Deployment/FrameworksTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/unit/Deployment/FrameworksTest.php b/tests/unit/Deployment/FrameworksTest.php index 26b0a2fba2..7e370a3687 100644 --- a/tests/unit/Deployment/FrameworksTest.php +++ b/tests/unit/Deployment/FrameworksTest.php @@ -18,11 +18,6 @@ final class FrameworksTest extends TestCase public function testStaticOutputStaysInsideSsrOutput(): void { foreach ($this->frameworks as $key => $framework) { - // Next.js exports a static site to its own root rather than into the ssr build. - if ($key === 'nextjs') { - continue; - } - $ssr = $framework['adapters']['ssr']['outputDirectory'] ?? null; $static = $framework['adapters']['static']['outputDirectory'] ?? null; @@ -30,6 +25,11 @@ final class FrameworksTest extends TestCase continue; } + // An unnested static directory is its own build root, like Next.js ./out. + if (\substr_count(\rtrim($static, '/'), '/') <= 1) { + continue; + } + $this->assertStringStartsWith( \rtrim($ssr, '/') . '/', \rtrim($static, '/') . '/',