MCPcopy
hub / github.com/CodebuffAI/codebuff / beforeEach

Function beforeEach

common/src/testing/setup.ts:153–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151 let dbSpy: DbSpies | undefined
152
153 const beforeEach = (): void => {
154 // Reset tool call ID counter for deterministic tests
155 resetToolCallIdCounter()
156
157 // Set up analytics mocks
158 if (analytics && analyticsModule) {
159 analyticsSpy = setupAnalyticsMocks(analyticsModule)
160 }
161
162 // Set up crypto mocks
163 if (crypto) {
164 cryptoSpy = setupCryptoMocks({ prefix: cryptoPrefix, sequential: true })
165 }
166
167 // Set up database mocks
168 if (database && dbModule) {
169 dbSpy = setupDbSpies(dbModule)
170 }
171 }
172
173 const afterEach = (): void => {
174 // Restore all mocks

Calls 4

resetToolCallIdCounterFunction · 0.90
setupAnalyticsMocksFunction · 0.90
setupCryptoMocksFunction · 0.90
setupDbSpiesFunction · 0.90

Tested by

no test coverage detected