This commit is contained in:
Aleksandr Statciuk 2022-01-10 15:00:35 +03:00
parent b9ab8ee78e
commit ba6036dd7d
18 changed files with 105 additions and 740 deletions

View file

@ -7,7 +7,7 @@ beforeEach(() => {
fs.mkdirSync('tests/__data__/output')
execSync(
'DB_DIR=tests/__data__/output/database node scripts/commands/create-database.js --channels=tests/__data__/input/site.channels.xml --max-clusters=1',
'DB_DIR=tests/__data__/output/database node scripts/commands/create-database.js --channels=tests/__data__/input/*.channels.xml --max-clusters=1',
{ encoding: 'utf8' }
)
})
@ -16,13 +16,13 @@ it('can create channels database', () => {
const output = content('tests/__data__/output/database/channels.db')
expect(output).toMatchObject({
lang: 'ca',
xmltv_id: 'AndorraTV.ad',
site_id: 'atv',
name: 'Andorra TV',
site: 'andorradifusio.ad',
channelsPath: 'tests/__data__/input/site.channels.xml',
configPath: 'tests/__data__/input/andorradifusio.ad.config.js',
lang: 'ru',
xmltv_id: 'CNNInternationalEurope.us',
site_id: '140',
name: 'CNN International Europe',
site: 'example.com',
channelsPath: 'tests/__data__/input/example.com.channels.xml',
configPath: 'tests/__data__/input/example.com.config.js',
cluster_id: 1
})
})

View file

@ -22,5 +22,5 @@ it('can load cluster', () => {
const lines = output.split('\n')
const parsed = JSON.parse(lines[0])
expect(parsed._id).toBe('K1kaxwsWVjsRIZL6')
expect(parsed._id).toBe('1XzrxNkSF2AQNBrT')
})