docs: remove TDD notes and irrelevant comments from policy tests

This commit is contained in:
Abhijit Balaji
2026-02-20 15:47:21 -08:00
parent 7ff6d563f1
commit b7b6773f9a
2 changed files with 5 additions and 7 deletions
+2 -2
View File
@@ -111,7 +111,7 @@ priority = 100
expect(result.errors).toHaveLength(0);
});
it('should match if ^ is used in commandRegex (TDD: currently fails)', async () => {
it('should match if ^ is used in commandRegex', async () => {
const result = await runLoadPoliciesFromToml(`
[[rule]]
toolName = "run_shell_command"
@@ -121,7 +121,7 @@ priority = 100
`);
expect(result.rules).toHaveLength(1);
// After the fix, this should match correctly
// The generated pattern is "command":"^git status
expect(
result.rules[0].argsPattern?.test('{"command":"git status"}'),
).toBe(true);
+3 -5
View File
@@ -145,16 +145,15 @@ describe('policy/utils', () => {
});
describe('commandRegex anchors', () => {
it('should transform ^ anchor correctly (TDD: currently failing to match)', () => {
it('should transform ^ anchor correctly', () => {
const patterns = buildArgsPatterns(undefined, undefined, '^git status');
const regex = new RegExp(patterns[0]!);
// JSON stringified command: {"command":"git status"}
const json = '{"command":"git status"}';
// This CURRENTLY fails because the pattern is "command":"^git status
expect(regex.test(json)).toBe(true);
});
it('should transform $ anchor correctly (TDD: currently failing to match)', () => {
it('should transform $ anchor correctly', () => {
const patterns = buildArgsPatterns(
undefined,
undefined,
@@ -162,11 +161,10 @@ describe('policy/utils', () => {
);
const regex = new RegExp(patterns[0]!);
const json = '{"command":"tmux send-keys -t superpowers:6 C-c"}';
// This CURRENTLY fails because $ matches end of JSON string, not end of command value
expect(regex.test(json)).toBe(true);
});
it('should handle $ anchor when other fields follow (TDD: currently failing)', () => {
it('should handle $ anchor when other fields follow', () => {
const patterns = buildArgsPatterns(undefined, undefined, 'git status$');
const regex = new RegExp(patterns[0]!);
const json = '{"command":"git status","dir_path":"/tmp"}';