From 3c7bc8fc72d7d12194dae08b3aa16cd9f18eeba8 Mon Sep 17 00:00:00 2001 From: freearhey Date: Mon, 12 Jun 2023 00:46:58 +0300 Subject: [PATCH] Delete tvgid.ua.test.js --- sites/tvgid.ua/tvgid.ua.test.js | 56 --------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 sites/tvgid.ua/tvgid.ua.test.js diff --git a/sites/tvgid.ua/tvgid.ua.test.js b/sites/tvgid.ua/tvgid.ua.test.js deleted file mode 100644 index 28a6112b..00000000 --- a/sites/tvgid.ua/tvgid.ua.test.js +++ /dev/null @@ -1,56 +0,0 @@ -// npx epg-grabber --config=sites/tvgid.ua/tvgid.ua.config.js --channels=sites/tvgid.ua/tvgid.ua.channels.xml --output=guide.xml --days=2 - -const { parser, url } = require('./tvgid.ua.config.js') -const iconv = require('iconv-lite') -const dayjs = require('dayjs') -const utc = require('dayjs/plugin/utc') -const customParseFormat = require('dayjs/plugin/customParseFormat') -dayjs.extend(customParseFormat) -dayjs.extend(utc) - -const date = dayjs.utc('2021-11-24', 'YYYY-MM-DD').startOf('d') -const channel = { - site_id: '1plus1', - xmltv_id: '1Plus1.ua' -} - -it('can generate valid url', () => { - expect(url({ channel, date })).toBe('https://tvgid.ua/channels/1plus1/24112021/tmall/') -}) - -it('can parse response', () => { - const content = `

Телепрограма 1+1 на 24.11.2021

1+1 Обговорити (917)
06:30 "Сніданок з 1+1" 
00:35Х/ф "Біля моря"
03:00 "#Гуднайт_клаб" 
` - const buffer = iconv.encode(Buffer.from(content), 'win1251') - const result = parser({ buffer, date }).map(p => { - p.start = p.start.toJSON() - p.stop = p.stop.toJSON() - return p - }) - - expect(result).toMatchObject([ - { - start: '2021-11-24T04:30:00.000Z', - stop: '2021-11-24T22:35:00.000Z', - title: `"Сніданок з 1+1"` - }, - { - start: '2021-11-24T22:35:00.000Z', - stop: '2021-11-25T01:00:00.000Z', - title: `Х/ф "Біля моря"` - }, - { - start: '2021-11-25T01:00:00.000Z', - stop: '2021-11-25T02:00:00.000Z', - title: `"#Гуднайт_клаб"` - } - ]) -}) - -it('can handle empty guide', () => { - const result = parser({ - date, - channel, - content: `` - }) - expect(result).toMatchObject([]) -})