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

Function flattenSteps

lib/plugin/junitReporter.js:204–222  ·  view source on GitHub ↗
(steps)

Source from the content-addressed store, hash-verified

202}
203
204function flattenSteps(steps) {
205 const out = []
206 let prevChain = []
207
208 for (const step of steps) {
209 const chain = metaChain(step)
210
211 let common = 0
212 while (common < chain.length && common < prevChain.length && chain[common].key === prevChain[common].key) common++
213
214 for (let d = common; d < chain.length; d++) {
215 out.push({ depth: d, step: chain[d].step })
216 }
217 out.push({ depth: chain.length, step })
218 prevChain = chain
219 }
220
221 return out
222}
223
224function metaChain(step) {
225 const chain = []

Callers 1

buildTestCaseFunction · 0.85

Calls 2

metaChainFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected