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

Function applyHook

lib/config.js:44–55  ·  view source on GitHub ↗
(hook, cfg)

Source from the content-addressed store, hash-verified

42// framework's own output module (when available) so it shows up in test
43// reports; the hook is still marked ran so it doesn't get retried.
44function applyHook(hook, cfg) {
45 try {
46 hook.fn(cfg)
47 } catch (err) {
48 hook.error = err
49 const out = globalThis.codeceptjs?.output
50 if (out && typeof out.error === 'function') out.error(`config hook failed: ${err.message}`)
51 else console.error('config hook failed:', err)
52 } finally {
53 hook.ran = true
54 }
55}
56
57const configFileNames = ['codecept.config.js', 'codecept.conf.js', 'codecept.js', 'codecept.config.cjs', 'codecept.conf.cjs', 'codecept.config.ts', 'codecept.conf.ts']
58

Callers 2

createMethod · 0.85
runPendingHooksMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected