MCPcopy Index your code
hub / github.com/codeaashu/claude-code / main

Function main

scripts/test-services.ts:195–228  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193}
194
195async function main() {
196 console.log('=== Services Layer Smoke Test ===')
197 console.log(`Environment: NODE_ENV=${process.env.NODE_ENV}`)
198 console.log(`Auth: ANTHROPIC_API_KEY=${process.env.ANTHROPIC_API_KEY ? '(set)' : '(not set)'}`)
199
200 // Test individual services first (order: least-dependent → most-dependent)
201 await testAnalyticsSink()
202 await testGrowthBook()
203 await testPolicyLimits()
204 await testRemoteManagedSettings()
205 await testBootstrapData()
206 await testSessionMemoryUtils()
207 await testCostTracker()
208
209 // Then test the full init sequence
210 await testInit()
211
212 // Summary
213 console.log('\n=== Summary ===')
214 const passed = results.filter(r => r.status === 'pass').length
215 const failed = results.filter(r => r.status === 'fail').length
216 const skipped = results.filter(r => r.status === 'skip').length
217 console.log(` ${passed} passed, ${failed} failed, ${skipped} skipped`)
218
219 if (failed > 0) {
220 console.log('\nFailed tests:')
221 for (const r of results.filter(r => r.status === 'fail')) {
222 console.log(` ❌ ${r.name}: ${r.detail}`)
223 }
224 process.exit(1)
225 }
226
227 console.log('\n✅ All services handle graceful degradation correctly')
228}
229
230main().catch(err => {
231 console.error('Fatal error in smoke test:', err)

Callers 1

test-services.tsFile · 0.70

Calls 8

testAnalyticsSinkFunction · 0.85
testGrowthBookFunction · 0.85
testPolicyLimitsFunction · 0.85
testBootstrapDataFunction · 0.85
testSessionMemoryUtilsFunction · 0.85
testCostTrackerFunction · 0.85
testInitFunction · 0.85

Tested by

no test coverage detected