mirror of
https://github.com/iptv-org/epg
synced 2025-12-16 18:37:01 -05:00
Added test command
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// npx epg-grabber --config=sites/rtmklik.rtm.gov.my/rtmklik.rtm.gov.my.config.js --channels=sites/rtmklik.rtm.gov.my/rtmklik.rtm.gov.my_my.channels.xml --output=guide.xml --days=2
|
||||
|
||||
const { parser, url } = require('./rtmklik.rtm.gov.my.config.js')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
@@ -12,7 +14,9 @@ const channel = {
|
||||
}
|
||||
|
||||
it('can generate valid url', () => {
|
||||
expect(url({ date, channel })).toBe('https://rtm.glueapi.io/v3/epg/2/ChannelSchedule?dateStart=2022-09-04&dateEnd=2022-09-04&timezone=0')
|
||||
expect(url({ date, channel })).toBe(
|
||||
'https://rtm.glueapi.io/v3/epg/2/ChannelSchedule?dateStart=2022-09-04&dateEnd=2022-09-04&timezone=0'
|
||||
)
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
@@ -29,7 +33,8 @@ it('can parse response', () => {
|
||||
start: '2022-09-04T19:00:00.000Z',
|
||||
stop: '2022-09-04T20:00:00.000Z',
|
||||
title: 'Hope Of Life',
|
||||
description: 'Kisah kehidupan 3 pakar bedah yang berbeza status dan latar belakang, namun mereka komited dengan kerjaya mereka sebagai doktor. Lakonan : Johnson Low, Elvis Chin, Mayjune Tan, Kelvin Liew, Jacky Kam dan Katrina Ho.'
|
||||
description:
|
||||
'Kisah kehidupan 3 pakar bedah yang berbeza status dan latar belakang, namun mereka komited dengan kerjaya mereka sebagai doktor. Lakonan : Johnson Low, Elvis Chin, Mayjune Tan, Kelvin Liew, Jacky Kam dan Katrina Ho.'
|
||||
}
|
||||
])
|
||||
})
|
||||
@@ -41,4 +46,4 @@ it('can handle empty guide', () => {
|
||||
content: `{"id":2,"channel":"TV2","channelId":"2","schedule":[]}`
|
||||
})
|
||||
expect(result).toMatchObject([])
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user