File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ const FRAMEWORK_FILTERS: Record<
4343 if ( payload . entryType === 'test' && payload . fullTitle ) {
4444 // Cucumber fullTitle format: "1: Scenario name" or "2: Scenario name"
4545 // Extract the row number and scenario name
46- const rowMatch = payload . fullTitle . match ( / ^ ( \d + ) : \s * ( .+ ) $ / )
46+ // Use non-greedy match and avoid catastrophic backtracking
47+ const rowMatch = payload . fullTitle . match ( / ^ ( \d + ) : \s * ( .* ) $ / )
4748 if ( rowMatch ) {
4849 const [ , rowNumber , scenarioName ] = rowMatch
4950 // Use spec file filter
@@ -184,7 +185,11 @@ class TestRunner {
184185 ? this . #buildSpecArgument( specFile , payload )
185186 : undefined
186187
187- const builder = FRAMEWORK_FILTERS [ framework ] || DEFAULT_FILTERS
188+ const builderCandidate = FRAMEWORK_FILTERS [ framework ]
189+ const builder =
190+ typeof builderCandidate === 'function'
191+ ? builderCandidate
192+ : DEFAULT_FILTERS
188193 return builder ( { specArg, payload } )
189194 }
190195
You can’t perform that action at this time.
0 commit comments