Commit 93c454e
committed
test(validation): add comprehensive API token type validation tests
Add tests for non-string API token inputs to improve coverage:
- Test TypeError for null token
- Test TypeError for undefined token
- Test TypeError for number token
- Test TypeError for object token
These tests cover the constructor validation in socket-sdk-class.ts:140
that ensures apiToken is a string type.
Coverage improvement:
- Overall coverage: 75.34% → 81.19% (+5.85%)
- socket-sdk-class.ts: 78.5% → 78.7% (553/703 statements)
- Validates TypeError path for non-string tokens1 parent a6b8444 commit 93c454e
1 file changed
+29
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
8 | 37 | | |
9 | 38 | | |
10 | 39 | | |
| |||
0 commit comments