mirror of
https://github.com/iptv-org/epg
synced 2026-05-11 03:47:02 -04:00
fix sky.it channels()
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const { parser, url } = require('./guidatv.sky.it.config.js')
|
||||
const { parser, url, channels } = require('./guidatv.sky.it.config.js')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const axios = require('axios')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
@@ -50,3 +51,23 @@ it('can handle empty guide', () => {
|
||||
})
|
||||
expect(result).toMatchObject([])
|
||||
})
|
||||
|
||||
it('can parse channel list', async () => {
|
||||
const mockResponse = fs.readFileSync(path.join(__dirname, '__data__', 'data.json'), 'utf8')
|
||||
axios.get = jest.fn().mockResolvedValue({ data: JSON.parse(mockResponse) })
|
||||
const results = await channels()
|
||||
|
||||
expect(results.length).toBe(154)
|
||||
expect(results[0]).toMatchObject({
|
||||
site_id: 'DTH#9115',
|
||||
name: 'Sky Uno',
|
||||
lang: 'it',
|
||||
xmltv_id: 'SkyUno.it',
|
||||
})
|
||||
expect(results[29]).toMatchObject({
|
||||
site_id: 'DTH#9094',
|
||||
name: 'Sky Sport24',
|
||||
lang: 'it',
|
||||
xmltv_id: 'SkySport24.it',
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user