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

Function fireHook

lib/mocha/hooks.js:74–92  ·  view source on GitHub ↗
(eventType, suite, error)

Source from the content-addressed store, hash-verified

72class AfterSuiteHook extends Hook {}
73
74function fireHook(eventType, suite, error) {
75 const hook = suite.ctx?.test?.title?.match(/"([^"]*)"/)[1]
76 switch (hook) {
77 case 'before each':
78 event.emit(eventType, new BeforeHook(suite, error))
79 break
80 case 'after each':
81 event.emit(eventType, new AfterHook(suite, error))
82 break
83 case 'before all':
84 event.emit(eventType, new BeforeSuiteHook(suite, error))
85 break
86 case 'after all':
87 event.emit(eventType, new AfterSuiteHook(suite, error))
88 break
89 default:
90 event.emit(eventType, suite, error)
91 }
92}
93
94class HookConfig {
95 constructor(hook) {

Callers 1

injectedFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected