Update save-results.js

This commit is contained in:
Aleksandr Statciuk 2022-01-30 20:54:09 +03:00
parent d2e43e46fe
commit 1b63609b7d
4 changed files with 11 additions and 29 deletions

View file

@ -0,0 +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":23,"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"}

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,"_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,"_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,"_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,"_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,"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"}

View file

@ -36,22 +36,9 @@ it('can save programs to database', () => {
it('can update queue', () => {
const output = content('tests/__data__/output/database/queue.db')
const expected = content('tests/__data__/expected/database/queue-with-errors.db')
expect(output[1]).toMatchObject({
_id: '0Wefq0oMR3feCcuY',
programCount: 23
})
})
it('can save errors', () => {
const output = content('tests/__data__/input/logs/errors.log')
expect(output[0]).toMatchObject({
_id: '00AluKCrCnfgrl8W',
site: 'directv.com',
xmltv_id: 'BravoEast.us',
error: 'Invalid header value char'
})
expect(output).toEqual(expected)
})
function content(filepath) {