MCPcopy
hub / github.com/codeceptjs/CodeceptJS / addExampleInTable

Function addExampleInTable

lib/mocha/gherkin.js:178–193  ·  view source on GitHub ↗
(exampleSteps, placeholders)

Source from the content-addressed store, hash-verified

176 return str
177}
178function addExampleInTable(exampleSteps, placeholders) {
179 const steps = JSON.parse(JSON.stringify(exampleSteps))
180 for (const placeholder in placeholders) {
181 steps.map(step => {
182 step = { ...step }
183 if (step.dataTable) {
184 for (const id in step.dataTable.rows) {
185 const cells = step.dataTable.rows[id].cells
186 cells.map(c => (c.value = c.value.replace(`<${placeholder}>`, placeholders[placeholder])))
187 }
188 }
189 return step
190 })
191 }
192 return steps
193}
194
195// Import translations at module level to avoid async in parser
196let translations = null

Callers 1

gherkinParserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected