mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
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.
This commit is contained in:
1 parent
c379f9194f
commit
9421f4a354
1 file changed
+5
-5
@@ -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, '/') . '/',
|
||||
|
||||
Reference in new issue
Block a user