refactor: uses TypeScript, better API usage #30
ci.yaml
on: pull_request
Build Docker
16s
Build, Lint, and Test
13s
Annotations
5 errors
|
Build, Lint, and Test
Process completed with exit code 1.
|
|
src/tvlistings.test.ts > getTVListings > should preserve the exact URL passed to the function:
src/tvlistings.test.ts#L278
AssertionError: expected "spy" to be called with arguments: [ …(2) ]
Received:
1st spy call:
[
- "https://tvlistings.gracenote.com/api/grid?lineupId=USA-lineupId-DEFAULT×pan=3&headendId=lineupId&country=USA&timezone=&device=-&postalCode=98107&isOverride=true&time=1752865200&pref=16,128&userId=-&aid=orbebb&languagecode=en-us",
+ "https://tvlistings.gracenote.com/api/grid?lineupId=USA-lineupId-DEFAULT×pan=3&headendId=lineupId&country=USA&timezone=America%2FNew_York&postalCode=30309&isOverride=true&pref=16%2C128&aid=orbebb&languagecode=en-us&time=1752878067",
{
"headers": {
- "User-Agent": Any<String>,
+ "User-Agent": "Mozilla/5.0 (iPad; CPU OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
},
},
]
Number of calls: 1
❯ src/tvlistings.test.ts:278:23
|
|
src/tvlistings.test.ts > getTVListings > should throw an error when response is not ok (4xx status):
src/tvlistings.test.ts#L139
AssertionError: expected "spy" to be called with arguments: [ 'https://example.com/api', …(1) ]
Received:
1st spy call:
[
- "https://example.com/api",
+ "https://tvlistings.gracenote.com/api/grid?lineupId=USA-lineupId-DEFAULT×pan=3&headendId=lineupId&country=USA&timezone=America%2FNew_York&postalCode=30309&isOverride=true&pref=16%2C128&aid=orbebb&languagecode=en-us&time=1752878067",
{
"headers": {
- "User-Agent": Any<String>,
+ "User-Agent": "Mozilla/5.0 (iPad; CPU OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
},
},
]
Number of calls: 1
❯ src/tvlistings.test.ts:139:23
|
|
src/tvlistings.test.ts > getTVListings > should include a User-Agent header in the request:
src/tvlistings.test.ts#L91
AssertionError: expected "spy" to be called with arguments: [ 'https://example.com/api', …(1) ]
Received:
1st spy call:
[
- "https://example.com/api",
+ "https://tvlistings.gracenote.com/api/grid?lineupId=USA-lineupId-DEFAULT×pan=3&headendId=lineupId&country=USA&timezone=America%2FNew_York&postalCode=30309&isOverride=true&pref=16%2C128&aid=orbebb&languagecode=en-us&time=1752878067",
{
"headers": {
- "User-Agent": Any<String>,
+ "User-Agent": "Mozilla/5.0 (iPad; CPU OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
},
},
]
Number of calls: 1
❯ src/tvlistings.test.ts:91:23
|
|
src/tvlistings.test.ts > getTVListings > should successfully fetch TV listings:
src/tvlistings.test.ts#L73
AssertionError: expected "spy" to be called with arguments: [ …(2) ]
Received:
1st spy call:
[
- "https://tvlistings.gracenote.com/api/grid?test=123",
+ "https://tvlistings.gracenote.com/api/grid?lineupId=USA-lineupId-DEFAULT×pan=3&headendId=lineupId&country=USA&timezone=America%2FNew_York&postalCode=30309&isOverride=true&pref=16%2C128&aid=orbebb&languagecode=en-us&time=1752878067",
{
"headers": {
- "User-Agent": Any<String>,
+ "User-Agent": "Mozilla/5.0 (iPad; CPU OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
},
},
]
Number of calls: 1
❯ src/tvlistings.test.ts:73:23
|