chore: implement requested changes

This commit is contained in:
Ralph Khreish
2025-10-02 11:54:19 +02:00
parent 0aaa105021
commit 7660a29a1a
5 changed files with 213 additions and 15 deletions

View File

@@ -38,17 +38,16 @@ describe('Prompt Migration Validation', () => {
if (lowerContent.includes(lowerPhrase)) {
// Check if this phrase is allowed in its context
const allowedInContext = allowedContexts[lowerPhrase];
if (allowedInContext) {
const isAllowed = allowedInContext.some((context) =>
const isAllowed =
allowedInContext &&
allowedInContext.some((context) =>
lowerContent.includes(context.toLowerCase())
);
if (isAllowed) {
return; // Skip this phrase - it's allowed in this context
}
}
// If we get here, the phrase is not allowed
expect(lowerContent).not.toContain(lowerPhrase);
expect(isAllowed).toBe(
true,
`File ${file} contains banned phrase "${phrase}" without allowed context`
);
}
});
});