|
1 | | -import type { AxiosResponse } from 'axios'; |
2 | | - |
3 | 1 | import type { Hostname } from '../../types'; |
4 | 2 |
|
5 | 3 | import { |
@@ -46,44 +44,5 @@ describe('renderer/utils/api/utils.ts', () => { |
46 | 44 | }); |
47 | 45 | }); |
48 | 46 |
|
49 | | - describe('getNextURLFromLinkHeader', () => { |
50 | | - it('should parse next url from link header', () => { |
51 | | - const mockResponse = { |
52 | | - headers: { |
53 | | - link: '<https://api.github.com/notifications?participating=false&page=2>; rel="next", <https://api.github.com/notifications?participating=false&page=2>; rel="last"', |
54 | | - }, |
55 | | - }; |
56 | | - |
57 | | - const result = getNextURLFromLinkHeader( |
58 | | - mockResponse as unknown as AxiosResponse, |
59 | | - ); |
60 | | - expect(result.toString()).toBe( |
61 | | - 'https://api.github.com/notifications?participating=false&page=2', |
62 | | - ); |
63 | | - }); |
64 | | - |
65 | | - it('should return null if no next url in link header', () => { |
66 | | - const mockResponse = { |
67 | | - headers: { |
68 | | - link: '<https://api.github.com/notifications?participating=false&page=2>; rel="last"', |
69 | | - }, |
70 | | - }; |
71 | | - |
72 | | - const result = getNextURLFromLinkHeader( |
73 | | - mockResponse as unknown as AxiosResponse, |
74 | | - ); |
75 | | - expect(result).toBeNull(); |
76 | | - }); |
77 | | - |
78 | | - it('should return null if no link header exists', () => { |
79 | | - const mockResponse = { |
80 | | - headers: {}, |
81 | | - }; |
82 | | - |
83 | | - const result = getNextURLFromLinkHeader( |
84 | | - mockResponse as unknown as AxiosResponse, |
85 | | - ); |
86 | | - expect(result).toBeNull(); |
87 | | - }); |
88 | | - }); |
| 47 | + |
89 | 48 | }); |
0 commit comments