chore: update test

This commit is contained in:
Jack Wotherspoon
2026-03-14 20:02:35 +01:00
parent 96cd5b7c5a
commit 8faed58289
2 changed files with 23 additions and 5 deletions
@@ -19,6 +19,12 @@ describe('formatArgsPattern', () => {
expect(formatArgsPattern(pattern)).toBe('git diff*');
});
it('should parse commandPrefix with escaped quotes (git show)', () => {
// buildArgsPatterns uses escapeRegex() which escapes quotes to \"
const pattern = new RegExp('\\"command\\":\\"git\\ show(?:[\\s"]|\\\\")');
expect(formatArgsPattern(pattern)).toBe('git show*');
});
it('should parse commandPrefix with special chars (npm run test:ci)', () => {
// escapeRegex escapes the colon
const pattern = new RegExp(
@@ -37,6 +43,11 @@ describe('formatArgsPattern', () => {
expect(formatArgsPattern(pattern)).toBe('npm run .*');
});
it('should parse commandRegex with escaped quotes', () => {
const pattern = new RegExp('\\"command\\":\\"npm run .*');
expect(formatArgsPattern(pattern)).toBe('npm run .*');
});
it('should parse file_path pattern', () => {
const pattern = new RegExp('"file_path":".*\\/plans\\/.*"');
expect(formatArgsPattern(pattern)).toBe('path: .*\\/plans\\/.*');