test(dev): cover loopback dev origins

Add a focused config regression test that locks in localhost, 127.0.0.1, and the existing LAN dev origin allowlist.
This commit is contained in:
Kfir Amar
2026-03-15 01:51:59 +02:00
parent 4bbaf55586
commit 783d7ae605

View File

@@ -0,0 +1,11 @@
import test from "node:test";
import assert from "node:assert/strict";
test("next config allows loopback dev origins alongside LAN access", async () => {
const { default: nextConfig } = await import("../../next.config.mjs");
assert.equal(Array.isArray(nextConfig.allowedDevOrigins), true);
assert.equal(nextConfig.allowedDevOrigins.includes("localhost"), true);
assert.equal(nextConfig.allowedDevOrigins.includes("127.0.0.1"), true);
assert.equal(nextConfig.allowedDevOrigins.includes("192.168.*"), true);
});