MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / matchStepFile

Function matchStepFile

lib/utils/pluginParser.js:95–108  ·  view source on GitHub ↗
(step, targetPath, targetLine)

Source from the content-addressed store, hash-verified

93 * Reads the step's stack via `step.line()` to get `file:row:col`.
94 */
95export function matchStepFile(step, targetPath, targetLine) {
96 if (!targetPath) return false
97 const stepLine = step.line && step.line()
98 if (!stepLine) return false
99
100 const parsed = parseStepLine(stepLine)
101 if (!parsed) return false
102
103 const fileMatches = parsed.file.includes(targetPath) || parsed.file.endsWith(targetPath)
104 if (!fileMatches) return false
105
106 if (targetLine != null && !Number.isNaN(targetLine) && parsed.line !== targetLine) return false
107 return true
108}
109
110function parseStepLine(stepLine) {
111 let line = stepLine.trim()

Callers 5

aiTrace.jsFile · 0.90
screenshot.jsFile · 0.90
makeStepFilterFunction · 0.90
initFileModeFunction · 0.90
heal.jsFile · 0.90

Calls 3

parseStepLineFunction · 0.85
lineMethod · 0.80
includesMethod · 0.80

Tested by

no test coverage detected