|
2 | 2 | * Unit tests for log-parser.ts |
3 | 3 | */ |
4 | 4 |
|
5 | | -import { parseLogLine, extractDomain, extractPort, parseAuditJsonlLine } from './log-parser'; |
| 5 | +import { parseLogLine, extractDomain, parseAuditJsonlLine } from './log-parser'; |
6 | 6 |
|
7 | 7 | describe('log-parser', () => { |
8 | 8 | describe('parseLogLine', () => { |
@@ -224,26 +224,6 @@ describe('log-parser', () => { |
224 | 224 | }); |
225 | 225 | }); |
226 | 226 |
|
227 | | - describe('extractPort', () => { |
228 | | - it('should extract port from CONNECT URL', () => { |
229 | | - expect(extractPort('api.github.com:443', 'CONNECT')).toBe('443'); |
230 | | - expect(extractPort('example.com:8080', 'CONNECT')).toBe('8080'); |
231 | | - }); |
232 | | - |
233 | | - it('should return undefined for CONNECT URL without port', () => { |
234 | | - expect(extractPort('api.github.com', 'CONNECT')).toBeUndefined(); |
235 | | - }); |
236 | | - |
237 | | - it('should return undefined for non-CONNECT methods', () => { |
238 | | - expect(extractPort('http://example.com:80/', 'GET')).toBeUndefined(); |
239 | | - expect(extractPort('http://example.com/', 'POST')).toBeUndefined(); |
240 | | - }); |
241 | | - |
242 | | - it('should not extract non-numeric port', () => { |
243 | | - expect(extractPort('api.github.com:abc', 'CONNECT')).toBeUndefined(); |
244 | | - }); |
245 | | - }); |
246 | | - |
247 | 227 | describe('parseAuditJsonlLine', () => { |
248 | 228 | it('should parse a valid JSONL CONNECT entry', () => { |
249 | 229 | const line = '{"ts":1761074374.646,"client":"172.30.0.20","host":"api.github.com:443","dest":"140.82.114.22:443","method":"CONNECT","status":200,"decision":"TCP_TUNNEL","url":"api.github.com:443"}'; |
|
0 commit comments