|
| 1 | +/** @fileoverview Tests for Socket SDK edge cases and error branches. */ |
| 2 | + |
| 3 | +import { describe, expect, it } from 'vitest' |
| 4 | + |
| 5 | +import { SocketSdk } from '../../src/index' |
| 6 | + |
| 7 | +describe('SocketSdk - Edge Cases and Error Branches', () => { |
| 8 | + describe('SDK configuration', () => { |
| 9 | + it('should handle SDK with minimal configuration', () => { |
| 10 | + const sdk = new SocketSdk('test-token') |
| 11 | + expect(sdk).toBeInstanceOf(SocketSdk) |
| 12 | + }) |
| 13 | + |
| 14 | + it('should handle SDK with all options', () => { |
| 15 | + const sdk = new SocketSdk('test-token', { |
| 16 | + baseUrl: 'https://custom.api.dev', |
| 17 | + timeout: 60000, |
| 18 | + retries: 5, |
| 19 | + retryDelay: 2000, |
| 20 | + }) |
| 21 | + expect(sdk).toBeInstanceOf(SocketSdk) |
| 22 | + }) |
| 23 | + |
| 24 | + it('should handle SDK with zero retries', () => { |
| 25 | + const sdk = new SocketSdk('test-token', { |
| 26 | + retries: 0, |
| 27 | + }) |
| 28 | + expect(sdk).toBeInstanceOf(SocketSdk) |
| 29 | + }) |
| 30 | + |
| 31 | + it('should handle SDK with custom timeout', () => { |
| 32 | + const sdk = new SocketSdk('test-token', { |
| 33 | + timeout: 5000, |
| 34 | + }) |
| 35 | + expect(sdk).toBeInstanceOf(SocketSdk) |
| 36 | + }) |
| 37 | + |
| 38 | + it('should handle SDK with custom retry delay', () => { |
| 39 | + const sdk = new SocketSdk('test-token', { |
| 40 | + retryDelay: 500, |
| 41 | + }) |
| 42 | + expect(sdk).toBeInstanceOf(SocketSdk) |
| 43 | + }) |
| 44 | + }) |
| 45 | +}) |
0 commit comments