fix(deploy): close container final review
This commit is contained in:
@@ -14,6 +14,20 @@ describe("resolveBackendUrl", () => {
|
||||
it("preserves the client default when Vite has no configured backend", () => {
|
||||
expect(backendBaseUrl).toBe(import.meta.env.VITE_BACKEND_URL ?? "http://localhost:8787");
|
||||
});
|
||||
|
||||
it.each(["/backend", "api", "//evil.test", "ftp://example.test", "https://user:pass@example.test"])(
|
||||
"rejects unsupported backend URL %j",
|
||||
(backendBaseUrl) => {
|
||||
expect(() => resolveBackendUrl({ backendBaseUrl })).toThrow(/BACKEND_BASE_URL/);
|
||||
},
|
||||
);
|
||||
|
||||
it.each(["", "/", "/api", "/api/", "http://localhost:8787", "https://api.example.test/v1"])(
|
||||
"accepts supported backend URL %j",
|
||||
(backendBaseUrl) => {
|
||||
expect(resolveBackendUrl({ backendBaseUrl })).toBe(backendBaseUrl);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe("joinBackendPath", () => {
|
||||
|
||||
Reference in New Issue
Block a user