test(integrations): tighten retired env boundaries

This commit is contained in:
Maximiliano Korp
2026-08-31 14:39:09 -07:00
committed by Max Korp
parent a26767c538
commit b48bbd20ea
2 changed files with 15 additions and 1 deletions
@@ -60,6 +60,18 @@ describe("retiredNameReference", () => {
false,
);
});
it("allows a lowercase-prefixed identifier containing the retired name", () => {
expect(retiredNameReference(RETIRED, "my" + RETIRED + "=cpk-...")).toBe(
false,
);
});
it("allows a lowercase-suffixed identifier containing the retired name", () => {
expect(retiredNameReference(RETIRED, RETIRED + "Legacy=cpk-...")).toBe(
false,
);
});
});
/**
+3 -1
View File
@@ -225,7 +225,9 @@ export function managedUrlEnvFileAssignment(text: string): string | null {
* @returns `true` when the line carries that exact name.
*/
export function retiredNameReference(name: string, text: string): boolean {
return new RegExp(String.raw`(?<![A-Z0-9_])${name}(?![A-Z0-9_])`).test(text);
return new RegExp(String.raw`(?<![A-Za-z0-9_])${name}(?![A-Za-z0-9_])`).test(
text,
);
}
interface Violation {