mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-07 02:58:02 +00:00
fix: skip test files in webhook extraction
Test files often mock webhook patterns (e.g., constructEvent in Stripe test mocks), causing false detection. Skip files in test directories. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
10c6646bc6
commit
0f06a65c94
1 changed files with 4 additions and 0 deletions
|
|
@ -1357,6 +1357,10 @@ export function extractORMQueries(
|
|||
// ============================================================================
|
||||
|
||||
function extractWebhooks(filePath: string, content: string, out: ExtractedWebhook[]): void {
|
||||
// Skip test files — they often mock webhook patterns
|
||||
const lp = filePath.toLowerCase();
|
||||
if (lp.includes('/test') || lp.includes('.test.') || lp.includes('.spec.') || lp.includes('__test')) return;
|
||||
|
||||
if (content.includes('constructEvent') || content.includes('webhooks.constructEvent')) {
|
||||
const eventTypes: string[] = [];
|
||||
const caseRe = /case\s+['"]([.\w-]+)['"]/g;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue