Update magentatv.at.test.js

This commit is contained in:
Aleksandr Statciuk 2022-03-10 14:01:57 +03:00
parent 52b15b4bd1
commit 17db974474

View file

@ -1,5 +1,5 @@
// npm run channels:parse -- --config=./sites/magentatv.at/magentatv.at.config.js --output=./sites/magentatv.at/magentatv.at_de.channels.xml
// npx epg-grabber --config=sites/magentatv.at/magentatv.at.config.js --channels=sites/magentatv.at/magentatv.at_de.channels.xml --output=guide.xml --days=2
// npm run channels:parse -- --config=./sites/magentatv.at/magentatv.at.config.js --output=./sites/magentatv.at/magentatv.at_at.channels.xml
// npx epg-grabber --config=sites/magentatv.at/magentatv.at.config.js --channels=sites/magentatv.at/magentatv.at_at.channels.xml --output=guide.xml --days=2
const { parser, url } = require('./magentatv.at.config.js')
const axios = require('axios')
@ -27,9 +27,7 @@ it('can parse response', done => {
const content = `{"entries":[{"o":"lgi-at-prodobo-master:13TH_Street_HD","l":[{"i":"crid:~~2F~~2Fbds.tv~~2F1870513,imi:c83a0bf1b04d6610d0517e63647772c1c8725693","t":"Law & Order: Special Victims Unit","s":1646778600000,"e":1646781300000,"c":"lgi-at-prodobo-master:genre-9","a":false,"r":false,"rm":false,"ad":[],"sl":[]}]}]}`
axios.get.mockImplementation(url => {
if (
url === 'https://prod.oesp.magentatv.at/oesp/v4/AT/deu/web/programschedules/20220309/2'
) {
if (url === 'https://prod.oesp.magentatv.at/oesp/v4/AT/deu/web/programschedules/20220309/2') {
return Promise.resolve({
data: JSON.parse(
`{"entries":[{"o":"lgi-at-prodobo-master:13TH_Street_HD","l":[{"i":"crid:~~2F~~2Fmedia-press.tv~~2F217048123,imi:ee14cfe306cb50502b03c96d58851c32345a9391","t":"FBI: Special Crime Unit","s":1646781300000,"e":1646784000000,"c":"lgi-at-prodobo-master:genre-9","a":false,"r":false,"rm":false,"ad":[],"sl":[]}]}]}`