mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Updating mediaset tests
This commit is contained in:
parent
eb277f1f2a
commit
2fd0581746
3 changed files with 8 additions and 22 deletions
File diff suppressed because one or more lines are too long
|
@ -1,10 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>301 Moved Permanently</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Moved Permanently</h1>
|
|
||||||
<p>The document has moved <a href="https://mediasetinfinity.mediaset.it/">here</a>.</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -7,7 +7,7 @@ const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
|
|
||||||
const date = dayjs.utc('2023-10-20', 'YYYY-MM-DD').startOf('d')
|
const date = dayjs.utc('2024-01-20', 'YYYY-MM-DD').startOf('d')
|
||||||
const channel = {
|
const channel = {
|
||||||
site_id: 'LB',
|
site_id: 'LB',
|
||||||
xmltv_id: '20.it'
|
xmltv_id: '20.it'
|
||||||
|
@ -15,30 +15,27 @@ const channel = {
|
||||||
|
|
||||||
it('can generate valid url', () => {
|
it('can generate valid url', () => {
|
||||||
expect(url({ channel, date })).toBe(
|
expect(url({ channel, date })).toBe(
|
||||||
'http://www.mediaset.it/guidatv/inc/canali/202310/20231020_LB.sjson'
|
'https://api-ott-prod-fe.mediaset.net/PROD/play/feed/allListingFeedEpg/v2.0?byListingTime=1705708800000~1705795200000&byCallSign=LB'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can parse response', () => {
|
it('can parse response', () => {
|
||||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'), 'utf8')
|
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'), 'utf8')
|
||||||
const results = parser({ content, date }).map(p => {
|
const results = parser({ content, date }).map(p => {
|
||||||
p.start = p.start.toJSON()
|
|
||||||
p.stop = p.stop.toJSON()
|
|
||||||
return p
|
return p
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(results[0]).toMatchObject({
|
expect(results[0]).toMatchObject({
|
||||||
start: '2023-10-20T04:10:00.000Z',
|
start: '2024-01-19 22:37',
|
||||||
stop: '2023-10-20T05:07:00.000Z',
|
stop: '2024-01-20 00:54',
|
||||||
title: 'Showreel',
|
title: 'Independence day: Rigenerazione',
|
||||||
description: 'INTRATTENIMENTO 15 - Italia, 2023',
|
description: 'Sequel del film di fantascienza Independence Day, con L. Hemsworth e B. Pullman. Dopo 20 anni la Terra si prepara a subire un secondo, terrificante attacco alieno.',
|
||||||
category: 'INTRATTENIMENTO'
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can handle empty guide', () => {
|
it('can handle empty guide', () => {
|
||||||
const result = parser({
|
const result = parser({
|
||||||
content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.html'), 'utf8')
|
content: '[]'
|
||||||
})
|
})
|
||||||
expect(result).toMatchObject([])
|
expect(result).toMatchObject([])
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue