TypeFetched/tests/debug-test.ts
Casey Collier b85b9a63e2 Initial commit: TypedFetch - Zero-dependency, type-safe HTTP client
Features:
- Zero configuration, just works out of the box
- Runtime type inference and validation
- Built-in caching with W-TinyLFU algorithm
- Automatic retries with exponential backoff
- Circuit breaker for resilience
- Request deduplication
- Offline support with queue
- OpenAPI schema discovery
- Full TypeScript support with type descriptors
- Modular architecture
- Configurable for advanced use cases

Built with bun, ready for npm publishing
2025-07-20 12:35:43 -04:00

34 lines
No EOL
1.2 KiB
TypeScript

#!/usr/bin/env bun
console.log('🔍 Debug Test - Checking Revolutionary Features')
console.log('===============================================')
try {
console.log('1. Importing revolutionary module...')
const module = await import('../src/index.js')
console.log('✅ Import successful')
console.log('2. Checking exports...')
console.log(' - tf:', typeof module.tf)
console.log(' - createTypedFetch:', typeof module.createTypedFetch)
console.log(' - WTinyLFUCache:', typeof module.WTinyLFUCache)
console.log('3. Testing tf instance...')
const { tf } = module
console.log(' - tf.get:', typeof tf.get)
console.log(' - tf.getMetrics:', typeof tf.getMetrics)
console.log(' - tf.getAllTypes:', typeof tf.getAllTypes)
console.log('4. Making simple request...')
const response = await fetch('https://httpbin.org/json')
const data = await response.json()
console.log('✅ Direct fetch works:', data ? 'Got data' : 'No data')
console.log('5. Testing tf.get...')
const result = await tf.get('https://httpbin.org/json')
console.log('✅ tf.get works:', result.data ? 'Got data' : 'No data')
} catch (error) {
console.error('❌ Error:', error.message)
console.error('Stack:', error.stack)
}