test(relay): keep the stage slug helper private (#9998)
This commit is contained in:
1 parent
ba873b8181
commit
ac93fbfad0
2 files changed
+1
-8
No files matched your search
@@ -11,17 +11,10 @@ import {
|
||||
RelayPublicDomainLabelTooLongError,
|
||||
relayPublicDomainForStage,
|
||||
relayResourceNameForStage,
|
||||
relayStageSlug,
|
||||
} from "./deploymentConfig.ts";
|
||||
|
||||
const isRelayPublicDomainLabelTooLongError = Schema.is(RelayPublicDomainLabelTooLongError);
|
||||
|
||||
describe("relayStageSlug", () => {
|
||||
it("matches Alchemy physical-name sanitization for default developer stages", () => {
|
||||
expect(relayStageSlug("dev_julius")).toBe("dev-julius");
|
||||
});
|
||||
});
|
||||
|
||||
describe("relayPublicDomainForStage", () => {
|
||||
it("uses the canonical relay hostname for production", () => {
|
||||
expect(relayPublicDomainForStage("prod", ".example.com.")).toBe("relay.example.com");
|
||||
|
||||
@@ -56,7 +56,7 @@ function appendDnsSafeSuffix(prefix: string, suffix: string): string {
|
||||
* Alchemy's physical-name helper sanitizes resource names after adding the
|
||||
* stage. Keep custom domains and runtime-created resources aligned with it.
|
||||
*/
|
||||
export function relayStageSlug(stage: string): string {
|
||||
function relayStageSlug(stage: string): string {
|
||||
return stage
|
||||
.toLowerCase()
|
||||
.replaceAll(/[^a-z0-9-]/g, "-")
|
||||
|
||||
Reference in new issue
Block a user