release: WRNexusJS 0.5.10
This commit is contained in:
@@ -9,6 +9,22 @@ import {
|
||||
stableStringify,
|
||||
} from "../src/index.ts";
|
||||
|
||||
test("derives the shared workspace root domain from configured public app origins", async () => {
|
||||
const previous = process.env.WRNEXUS_WORKSPACE_ORIGINS;
|
||||
process.env.WRNEXUS_WORKSPACE_ORIGINS = JSON.stringify({
|
||||
admin: "https://admin.staging.example.com",
|
||||
citizen: "https://citizen.staging.example.com",
|
||||
sso: "https://sso.staging.example.com",
|
||||
});
|
||||
try {
|
||||
const { workspaceRootDomain } = await import("../src/workspace.ts");
|
||||
expect(workspaceRootDomain()).toBe("staging.example.com");
|
||||
} finally {
|
||||
if (previous === undefined) delete process.env.WRNEXUS_WORKSPACE_ORIGINS;
|
||||
else process.env.WRNEXUS_WORKSPACE_ORIGINS = previous;
|
||||
}
|
||||
});
|
||||
|
||||
function context(url: string, headers: HeadersInit = {}) {
|
||||
const parsed = new URL(url);
|
||||
return createContext(new Request(parsed, { headers }), parsed);
|
||||
|
||||
Reference in New Issue
Block a user