diff --git a/sites/allente.dk/allente.dk.test.js b/sites/allente.dk/allente.dk.test.js index d79521f1..e6f0caa9 100644 --- a/sites/allente.dk/allente.dk.test.js +++ b/sites/allente.dk/allente.dk.test.js @@ -2,6 +2,8 @@ const { parser, url } = require('./allente.dk.config.js') const dayjs = require('dayjs') const utc = require('dayjs/plugin/utc') const customParseFormat = require('dayjs/plugin/customParseFormat') +const { readFileSync } = require('fs') +const { resolve } = require('path') dayjs.extend(customParseFormat) dayjs.extend(utc) @@ -16,8 +18,7 @@ it('can generate valid url', () => { }) it('can parse response', () => { - const content = - '' + const content = readFileSync(resolve(__dirname, '__data__/content.json')) const result = parser({ content, channel }).map(p => { p.start = p.start.toJSON() p.stop = p.stop.toJSON() diff --git a/sites/foxsports.com.au/__data__/content.json b/sites/foxsports.com.au/__data__/content.json index a2affed5..6ec175aa 100644 --- a/sites/foxsports.com.au/__data__/content.json +++ b/sites/foxsports.com.au/__data__/content.json @@ -1 +1,34 @@ -{"channel-programme":[{"id":"31cc8b4c-3711-49f0-bf22-2ec3993b0a07","programmeTitle":"NRL","title":"Eels v Titans","startTime":"2022-12-14T00:00:00+11:00","endTime":"2022-12-14T01:00:00+11:00","duration":60,"live":false,"genreId":"5c389cf4-8db7-4b52-9773-52355bd28559","channelId":2,"channelName":"FOX League","channelAbbreviation":"LEAGUE","programmeUID":235220,"round":"R1","statsMatchId":null,"closedCaptioned":true,"statsFixtureId":10207,"genreTitle":"Rugby League","parentGenreId":"a953f929-2d12-41a4-b0e9-97f401afff11","parentGenreTitle":"Sport","pmgId":"PMG01306944","statsSport":"league","type":"GAME","hiDef":true,"widescreen":true,"classification":"","synopsis":"The Eels and Titans have plenty of motivation this season after heartbreaking Finals losses in 2021. Parramatta has won their past five against Gold Coast.","preGameStartTime":null,"closeCaptioned":true}]} \ No newline at end of file +{ + "channel-programme":[ + { + "id":"31cc8b4c-3711-49f0-bf22-2ec3993b0a07", + "programmeTitle":"NRL", + "title":"Eels v Titans", + "startTime":"2022-12-14T00:00:00+11:00", + "endTime":"2022-12-14T01:00:00+11:00", + "duration":60, + "live":false, + "genreId":"5c389cf4-8db7-4b52-9773-52355bd28559", + "channelId":2, + "channelName":"FOX League", + "channelAbbreviation":"LEAGUE", + "programmeUID":235220, + "round":"R1", + "statsMatchId":null, + "closedCaptioned":true, + "statsFixtureId":10207, + "genreTitle":"Rugby League", + "parentGenreId":"a953f929-2d12-41a4-b0e9-97f401afff11", + "parentGenreTitle":"Sport", + "pmgId":"PMG01306944", + "statsSport":"league", + "type":"GAME", + "hiDef":true, + "widescreen":true, + "classification":"", + "synopsis":"The Eels and Titans have plenty of motivation this season after heartbreaking Finals losses in 2021. Parramatta has won their past five against Gold Coast.", + "preGameStartTime":null, + "closeCaptioned":true + } + ] +} \ No newline at end of file diff --git a/sites/foxsports.com.au/foxsports.com.au.test.js b/sites/foxsports.com.au/foxsports.com.au.test.js index b6ed8a02..1978d8f0 100644 --- a/sites/foxsports.com.au/foxsports.com.au.test.js +++ b/sites/foxsports.com.au/foxsports.com.au.test.js @@ -38,6 +38,6 @@ it('can parse response', () => { }) it('can handle empty guide', () => { - const result = parser({content: ''}, channel) + const result = parser({content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))}, channel) expect(result).toMatchObject([]) }) diff --git a/sites/frikanalen.no/__data__/content.json b/sites/frikanalen.no/__data__/content.json index 0f01cdcd..221056a1 100644 --- a/sites/frikanalen.no/__data__/content.json +++ b/sites/frikanalen.no/__data__/content.json @@ -1 +1 @@ -{"count":83,"next":null,"previous":null,"results":[{"id":135605,"video":{"id":626094,"name":"FSCONS 2017 - Keynote: TBA - Linda Sandvik","header":"Linda Sandvik's keynote at FSCONS 2017\\r\\n\\r\\nRecorded by NUUG for FSCONS.","description":null,"creator":"davidwnoble@gmail.com","organization":{"id":82,"name":"NUUG","homepage":"https://www.nuug.no/","description":"Forening NUUG er for alle som er interessert i fri programvare, åpne standarder og Unix-lignende operativsystemer.","postalAddress":"","streetAddress":"","editorId":2148,"editorName":"David Noble","editorEmail":"davidwnoble@gmail.com","editorMsisdn":"","fkmember":true},"duration":"00:57:55.640000","categories":["Samfunn"]},"schedulereason":5,"starttime":"2022-01-19T00:47:00+01:00","endtime":"2022-01-19T01:44:55.640000+01:00","duration":"00:57:55.640000"}]} \ No newline at end of file +{"count":83,"next":null,"previous":null,"results":[{"id":135605,"video":{"id":626094,"name":"FSCONS 2017 - Keynote: TBA - Linda Sandvik","header":"Linda Sandvik's keynote at FSCONS 2017\r\n\r\nRecorded by NUUG for FSCONS.","description":null,"creator":"davidwnoble@gmail.com","organization":{"id":82,"name":"NUUG","homepage":"https://www.nuug.no/","description":"Forening NUUG er for alle som er interessert i fri programvare, åpne standarder og Unix-lignende operativsystemer.","postalAddress":"","streetAddress":"","editorId":2148,"editorName":"David Noble","editorEmail":"davidwnoble@gmail.com","editorMsisdn":"","fkmember":true},"duration":"00:57:55.640000","categories":["Samfunn"]},"schedulereason":5,"starttime":"2022-01-19T00:47:00+01:00","endtime":"2022-01-19T01:44:55.640000+01:00","duration":"00:57:55.640000"}]} \ No newline at end of file