Update create-database.test.js

This commit is contained in:
Aleksandr Statciuk 2022-01-15 00:17:18 +03:00
parent 5db31acc83
commit 091d919c60

View file

@ -15,31 +15,34 @@ beforeEach(() => {
it('can create channels database', () => { it('can create channels database', () => {
const output = content('tests/__data__/output/database/channels.db') const output = content('tests/__data__/output/database/channels.db')
expect(output[0]).toMatchObject({ expect(output).toEqual(
lang: 'en', expect.arrayContaining([
country: 'LV', expect.objectContaining({
xmltv_id: '1Plus2.lv', lang: 'en',
site_id: '1341', country: 'LV',
name: '1+2', xmltv_id: '1Plus2.lv',
site: 'example.com', site_id: '1341',
channelsPath: 'tests/__data__/input/sites/example.com_en-ee.channels.xml', name: '1+2',
configPath: 'tests/__data__/input/sites/example.com.config.js', site: 'example.com',
gid: 'en-ee', channelsPath: 'tests/__data__/input/sites/example.com_en-ee.channels.xml',
cluster_id: 1 configPath: 'tests/__data__/input/sites/example.com.config.js',
}) gid: 'en-ee',
cluster_id: 1
expect(output[1]).toMatchObject({ }),
lang: 'ru', expect.objectContaining({
country: 'US', lang: 'ru',
xmltv_id: 'CNNInternationalEurope.us', country: 'US',
site_id: '140', xmltv_id: 'CNNInternationalEurope.us',
name: 'CNN International Europe', site_id: '140',
site: 'example.com', name: 'CNN International Europe',
channelsPath: 'tests/__data__/input/sites/example.com_ca-nl.channels.xml', site: 'example.com',
configPath: 'tests/__data__/input/sites/example.com.config.js', channelsPath: 'tests/__data__/input/sites/example.com_ca-nl.channels.xml',
gid: 'ca-nl', configPath: 'tests/__data__/input/sites/example.com.config.js',
cluster_id: 1 gid: 'ca-nl',
}) cluster_id: 1
})
])
)
}) })
function content(filepath) { function content(filepath) {