Update update-guides.js

This commit is contained in:
Aleksandr Statciuk 2022-01-30 21:37:48 +03:00
parent 1b63609b7d
commit bd86077ab5
7 changed files with 64 additions and 26 deletions

View file

@ -0,0 +1 @@
{"xmltv_id":"BravoEast.us","site":"directv.com","site_id":"237","lang":"en","date":"2022-01-21T00:00:00Z","error":"Invalid header value char"}

View file

@ -0,0 +1,5 @@
{"group":"us/directv.com","count":1,"status":1}
{"group":"fr/chaines-tv.orange.fr","count":1,"status":0}
{"group":"bh/chaines-tv.orange.fr","count":1,"status":0}
{"group":"ge/magticom.ge","count":1,"status":0}
{"group":"zw/dstv.com","count":1,"status":0}

View file

@ -1,3 +0,0 @@
{"group":"fr/chaines-tv.orange.fr","count":1}
{"group":"bh/chaines-tv.orange.fr","count":1}
{"group":"zw/dstv.com","count":1}

View file

@ -1,4 +1,4 @@
{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","site":"directv.com","configPath":"sites/directv.com/directv.com.config.js","groups":["us/directv.com"],"cluster_id":84,"programCount":0,"error":"Invalid header value char","_id":"00AluKCrCnfgrl8W"}
{"lang":"fr","xmltv_id":"CNNInternationalEurope.us","site_id":"53","site":"chaines-tv.orange.fr","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["fr/chaines-tv.orange.fr", "bh/chaines-tv.orange.fr"],"cluster_id":1,"programCount":32,"error":null,"_id":"0Wefq0oMR3feCcuY"}
{"lang":"ru","xmltv_id":"CNNInternationalEurope.us","site_id":"140","site":"magticom.ge","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ge/magticom.ge"],"cluster_id":1,"programCount":0,"error":null,"_id":"1XzrxNkSF2AQNBrT"}
{"lang":"en","xmltv_id":"MNetMovies2.za","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","site":"dstv.com","configPath":"sites/dstv.com/dstv.com.config.js","groups":["zw/dstv.com"],"cluster_id":120,"programCount":14,"error":null,"_id":"1lnhXpN7g0ER5XwN"}
{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","site":"directv.com","configPath":"sites/directv.com/directv.com.config.js","groups":["us/directv.com"],"cluster_id":84,"programCount":0,"date":"2022-01-21T00:00:00Z","error":"Invalid header value char","_id":"00AluKCrCnfgrl8W"}
{"lang":"fr","xmltv_id":"CNNInternationalEurope.us","site_id":"53","site":"chaines-tv.orange.fr","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["fr/chaines-tv.orange.fr", "bh/chaines-tv.orange.fr"],"cluster_id":1,"programCount":32,"date":"2022-01-21T00:00:00Z","error":null,"_id":"0Wefq0oMR3feCcuY"}
{"lang":"ru","xmltv_id":"CNNInternationalEurope.us","site_id":"140","site":"magticom.ge","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ge/magticom.ge"],"cluster_id":1,"programCount":0,"date":"2022-01-21T00:00:00Z","error":null,"_id":"1XzrxNkSF2AQNBrT"}
{"lang":"en","xmltv_id":"MNetMovies2.za","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","site":"dstv.com","configPath":"sites/dstv.com/dstv.com.config.js","groups":["zw/dstv.com"],"cluster_id":120,"programCount":14,"date":"2022-01-21T00:00:00Z","error":null,"_id":"1lnhXpN7g0ER5XwN"}

View file

@ -16,6 +16,8 @@ beforeEach(() => {
'DB_DIR=tests/__data__/temp/database DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output LOGS_DIR=tests/__data__/output/logs node scripts/commands/update-guides.js',
{ encoding: 'utf8' }
)
console.log(stdout)
})
afterEach(() => {
@ -32,11 +34,20 @@ it('can generate /guides', () => {
const expected2 = content('tests/__data__/expected/guides/zw/dstv.com.epg.xml')
expect(output2).toBe(expected2)
})
const output3 = content('tests/__data__/output/logs/update-guides.log')
const expected3 = content('tests/__data__/expected/logs/update-guides.log')
it('can create guides.log', () => {
const output = content('tests/__data__/output/logs/guides.log')
const expected = content('tests/__data__/expected/logs/guides.log')
expect(output3).toBe(expected3)
expect(output).toBe(expected)
})
it('can create errors.log', () => {
const output = content('tests/__data__/output/logs/errors.log')
const expected = content('tests/__data__/expected/logs/errors.log')
expect(output).toBe(expected)
})
function content(filepath) {