From 014bcec560357cbb13a81b9bc8a3cd8160f5781e Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Wed, 15 Sep 2021 11:20:06 +0300 Subject: [PATCH] Update utils.test.js --- tests/utils.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/utils.test.js b/tests/utils.test.js index df69795..f8d57aa 100644 --- a/tests/utils.test.js +++ b/tests/utils.test.js @@ -2,13 +2,13 @@ import mockAxios from 'jest-mock-axios' import utils from '../src/utils' it('can load valid config.js', () => { - const config = utils.loadConfig('./tests/input/example.com.config.js') + const config = utils.loadConfig({ config: './tests/input/example.com.config.js' }) expect(config).toMatchObject({ channels: 'tests/input/example.com.channels.xml', days: 1, delay: 3000, lang: 'en', - output: 'guide.xml', + output: 'tests/output/guide.xml', site: 'example.com' }) expect(config.request).toMatchObject({ @@ -115,7 +115,7 @@ it('can fetch data', async () => { }) it('can build request async', async () => { - const config = utils.loadConfig('./tests/input/async.config.js') + const config = utils.loadConfig({ config: './tests/input/async.config.js' }) return utils.buildRequest({}, config).then(request => { expect(request).toMatchObject({ data: { accountID: '123' }, @@ -136,14 +136,14 @@ it('can build request async', async () => { }) it('can load logo async', async () => { - const config = utils.loadConfig('./tests/input/async.config.js') + const config = utils.loadConfig({ config: './tests/input/async.config.js' }) return utils.loadLogo({}, config).then(logo => { expect(logo).toBe('http://example.com/logos/1TV.png?x=шеллы&sid=777') }) }) it('can parse programs async', async () => { - const config = utils.loadConfig('./tests/input/async.config.js') + const config = utils.loadConfig({ config: './tests/input/async.config.js' }) return utils .parsePrograms({ channel: { xmltv_id: '1tv', lang: 'en' } }, config) .then(programs => {