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

Method run

lib/step/func.js:18–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 }
17
18 run() {
19 if (!this.fn) throw new Error('Function is not set')
20
21 // we wrap that function to track time and status
22 // and disable it in dry run mode
23 this.args = Array.prototype.slice.call(arguments)
24 this.startTime = +Date.now()
25
26 if (store.dryRun) {
27 this.setStatus('success')
28 // should we add Proxy and dry run resolver here?
29 return Promise.resolve(true)
30 }
31
32 let result
33 try {
34 result = this.fn.apply(this.helper, this.args)
35 this.setStatus('success')
36 this.endTime = +Date.now()
37 } catch (err) {
38 this.endTime = +Date.now()
39 this.setStatus('failed')
40 throw err
41 }
42 return result
43 }
44}
45
46export default FuncStep

Callers

nothing calls this directly

Calls 1

setStatusMethod · 0.80

Tested by

no test coverage detected