From df51fe3d45b10ad2398fb0ff45c70d218ed62600 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 10 Jan 2022 23:09:01 +0300 Subject: [PATCH] wip --- tests/__data__/expected/api/channels.json | 2 +- tests/__data__/input/database/channels.db | 1 + tests/commands/create-matrix.test.js | 2 +- tests/commands/update-guides.test.js | 5 ++--- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/__data__/expected/api/channels.json b/tests/__data__/expected/api/channels.json index 9b5f4b1d..4d674b87 100644 --- a/tests/__data__/expected/api/channels.json +++ b/tests/__data__/expected/api/channels.json @@ -1 +1 @@ -[{"id":"CNNInternationalEurope.us","name":["CNN International Europe","CNN Int"],"logo":"https://proxymedia.woopic.com/api/v1/images/553%2Flogos%2Fv2%2Flogos%2Flivetv_cnn%2F20151026_092415%2FwebTVLogo%2Flogo_180x96.png","country":"US"},{"id":"MNetMovies2.za","name":["M-Net Movies 2"],"logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","country":"ZA"}] \ No newline at end of file +[{"id":"BravoEast.us","name":["Bravo East"],"logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","country":"US"},{"id":"CNNInternationalEurope.us","name":["CNN International Europe","CNN Int"],"logo":"https://proxymedia.woopic.com/api/v1/images/553%2Flogos%2Fv2%2Flogos%2Flivetv_cnn%2F20151026_092415%2FwebTVLogo%2Flogo_180x96.png","country":"US"},{"id":"MNetMovies2.za","name":["M-Net Movies 2"],"logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","country":"ZA"}] \ No newline at end of file diff --git a/tests/__data__/input/database/channels.db b/tests/__data__/input/database/channels.db index d03ba482..48880755 100644 --- a/tests/__data__/input/database/channels.db +++ b/tests/__data__/input/database/channels.db @@ -1,3 +1,4 @@ +{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","name":"Bravo East","site":"directv.com","channelsPath":"sites/directv.com/directv.com_us.channels.xml","configPath":"sites/directv.com/directv.com.config.js","cluster_id":84,"country":"US","_id":"00AluKCrCnfgrl8W"} {"lang":"fr","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"53","logo":"https://proxymedia.woopic.com/api/v1/images/553%2Flogos%2Fv2%2Flogos%2Flivetv_cnn%2F20151026_092415%2FwebTVLogo%2Flogo_180x96.png","name":"CNN International Europe","site":"chaines-tv.orange.fr","channelsPath":"sites/chaines-tv.orange.fr/chaines-tv.orange.fr_fr.channels.xml","configPath":"sites/chaines-tv.orange.fr/chaines-tv.orange.fr.config.js","cluster_id":1,"_id":"0Wefq0oMR3feCcuY"} {"lang":"ru","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"140","logo":"https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg","name":"CNN Int","site":"magticom.ge","channelsPath":"sites/magticom.ge/magticom.ge_ge.channels.xml","configPath":"sites/magticom.ge/magticom.ge.config.js","cluster_id":1,"_id":"1XzrxNkSF2AQNBrT"} {"lang":"en","country":"ZA","xmltv_id":"MNetMovies2.za","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","name":"M-Net Movies 2","site":"dstv.com","channelsPath":"sites/dstv.com/dstv.com_zw.channels.xml","configPath":"sites/dstv.com/dstv.com.config.js","cluster_id":120,"_id":"1lnhXpN7g0ER5XwN"} diff --git a/tests/commands/create-matrix.test.js b/tests/commands/create-matrix.test.js index fb5a7919..ee0a1319 100644 --- a/tests/commands/create-matrix.test.js +++ b/tests/commands/create-matrix.test.js @@ -24,5 +24,5 @@ it('can create valid matrix', () => { } ) - expect(result).toBe('::set-output name=matrix::{"cluster_id":[1,120]}\n') + expect(result).toBe('::set-output name=matrix::{"cluster_id":[1,84,120]}\n') }) diff --git a/tests/commands/update-guides.test.js b/tests/commands/update-guides.test.js index ceac1bbe..31965ba3 100644 --- a/tests/commands/update-guides.test.js +++ b/tests/commands/update-guides.test.js @@ -15,11 +15,10 @@ beforeEach(() => { 'tests/__data__/temp/database/programs.db' ) - const results = execSync( + execSync( 'DB_DIR=tests/__data__/temp/database GUIDES_DIR=tests/__data__/output/guides node scripts/commands/update-guides.js', { encoding: 'utf8' } ) - // console.log(results) }) afterEach(() => { @@ -33,7 +32,7 @@ it('can generate epg.xml', () => { expect(output).toBe(expected) }) -it('can generate /countries guides', () => { +fit('can generate /countries guides', () => { const output1 = content('tests/__data__/output/guides/countries/us.epg.xml') const expected1 = content('tests/__data__/expected/guides/countries/us.epg.xml')