From c379f9194fcd1fcba2d4438371c3e3f1b8195f18 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 13 Aug 2026 11:38:11 +0530 Subject: [PATCH] test(sites): assert static output stays inside the ssr build The rendering tests added here pass on main, because the detector already matched both TanStack Start server entries; the output directory was the only thing wrong. So nothing in the branch failed before the fix. Assert the rule the two corrected entries broke instead: a framework's static adapter serves files from inside its ssr build output, because the pair describes one build. On main this fails on nuxt and tanstack-start, the two entries this branch corrects. Next.js is skipped, its static export genuinely leaves the ssr root. This replaces the literal directory assertions, which restated the config beside them. CollectionsTest is the precedent: load the config file, check a rule it cannot state about itself. --- tests/unit/Deployment/FrameworksTest.php | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/unit/Deployment/FrameworksTest.php diff --git a/tests/unit/Deployment/FrameworksTest.php b/tests/unit/Deployment/FrameworksTest.php new file mode 100644 index 0000000000..26b0a2fba2 --- /dev/null +++ b/tests/unit/Deployment/FrameworksTest.php @@ -0,0 +1,40 @@ +frameworks = require('app/config/frameworks.php'); + } + + 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; + + if ($ssr === null || $static === null) { + continue; + } + + $this->assertStringStartsWith( + \rtrim($ssr, '/') . '/', + \rtrim($static, '/') . '/', + "Framework '{$key}' serves static files from outside its ssr build output." + ); + } + } +}