From b45d9147274a631df162a9bb25effba0c8a6e45a Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 31 Jan 2022 05:32:21 +0300 Subject: [PATCH] Update update-guides.test.js --- .../__data__/expected/logs/errors/ru/yandex.ru.log | 1 + .../expected/logs/errors/us/directv.com.log | 1 + tests/__data__/expected/logs/guides.log | 6 +++--- tests/commands/update-guides.test.js | 13 +++++++++---- 4 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 tests/__data__/expected/logs/errors/ru/yandex.ru.log create mode 100644 tests/__data__/expected/logs/errors/us/directv.com.log diff --git a/tests/__data__/expected/logs/errors/ru/yandex.ru.log b/tests/__data__/expected/logs/errors/ru/yandex.ru.log new file mode 100644 index 00000000..cba9a795 --- /dev/null +++ b/tests/__data__/expected/logs/errors/ru/yandex.ru.log @@ -0,0 +1 @@ +{"xmltv_id":"Perviykanal.ru","site":"yandex.ru","site_id":"1","lang":"ru","date":"2022-01-21T00:00:00Z","error":"Some error"} \ No newline at end of file diff --git a/tests/__data__/expected/logs/errors/us/directv.com.log b/tests/__data__/expected/logs/errors/us/directv.com.log new file mode 100644 index 00000000..9410d598 --- /dev/null +++ b/tests/__data__/expected/logs/errors/us/directv.com.log @@ -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"} \ No newline at end of file diff --git a/tests/__data__/expected/logs/guides.log b/tests/__data__/expected/logs/guides.log index 1ca6b562..67cb1ca0 100644 --- a/tests/__data__/expected/logs/guides.log +++ b/tests/__data__/expected/logs/guides.log @@ -1,6 +1,6 @@ -{"group":"us/directv.com","count":1,"status":1} +{"group":"us/directv.com","count":0,"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":"ru/yandex.ru","count":1,"status":1} +{"group":"ge/magticom.ge","count":0,"status":1} +{"group":"ru/yandex.ru","count":0,"status":1} {"group":"zw/dstv.com","count":1,"status":0} diff --git a/tests/commands/update-guides.test.js b/tests/commands/update-guides.test.js index 182c2837..9756d836 100644 --- a/tests/commands/update-guides.test.js +++ b/tests/commands/update-guides.test.js @@ -41,11 +41,16 @@ it('can create guides.log', () => { 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') +it('can log errors', () => { + const output1 = content('tests/__data__/output/logs/errors/ru/yandex.ru.log') + const expected1 = content('tests/__data__/expected/logs/errors/ru/yandex.ru.log') - expect(output).toBe(expected) + expect(output1).toBe(expected1) + + const output2 = content('tests/__data__/output/logs/errors/us/directv.com.log') + const expected2 = content('tests/__data__/expected/logs/errors/us/directv.com.log') + + expect(output2).toBe(expected2) }) function content(filepath) {