mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
Update create-queue.js
This commit is contained in:
parent
62e79d982c
commit
ca3913f357
5 changed files with 47 additions and 15 deletions
|
@ -1,2 +1,4 @@
|
|||
{"lang":"en","xmltv_id":"CNNInternationalEurope2.us","site_id":"141","name":"CNN International Europe 2","site":"example.com","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ca-nl/example.com"],"cluster_id":1,"_id":"Q1l5y46bT530JS2z"}
|
||||
{"lang":"ru","xmltv_id":"CNNInternationalEurope.us","site_id":"140","name":"CNN International Europe","site":"example.com","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ca-nl/example.com"],"cluster_id":1,"_id":"auE4QTbPiCEcHyf5"}
|
||||
{"lang":"en","xmltv_id":"CNNInternationalEurope2.us","site_id":"141","site":"example.com","date":"2022-01-30T00:00:00.000Z","groups":["ca-nl/example.com"],"cluster_id":1,"_id":"c4pT2p7Q4aBVh13M"}
|
||||
{"lang":"en","xmltv_id":"CNNInternationalEurope2.us","site_id":"141","site":"example.com","date":"2022-01-31T00:00:00.000Z","groups":["ca-nl/example.com"],"cluster_id":1,"_id":"POYAcMssTAgZu4Yk"}
|
||||
{"lang":"ru","xmltv_id":"CNNInternationalEurope.us","site_id":"140","site":"example.com","date":"2022-01-30T00:00:00.000Z","groups":["ca-nl/example.com"],"cluster_id":1,"_id":"TYDwYLsrkmPtTLT2"}
|
||||
{"lang":"ru","xmltv_id":"CNNInternationalEurope.us","site_id":"140","site":"example.com","date":"2022-01-31T00:00:00.000Z","groups":["ca-nl/example.com"],"cluster_id":1,"_id":"98cKRthEhMmKEnwx"}
|
||||
|
|
|
@ -7,7 +7,7 @@ beforeEach(() => {
|
|||
fs.mkdirSync('tests/__data__/output')
|
||||
|
||||
const stdout = execSync(
|
||||
'DB_DIR=tests/__data__/output/database node scripts/commands/create-queue.js --channels=tests/__data__/input/sites/*.channels.xml --max-clusters=1',
|
||||
'DB_DIR=tests/__data__/output/database node scripts/commands/create-queue.js --channels=tests/__data__/input/sites/*.channels.xml --max-clusters=1 --days=2',
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
})
|
||||
|
@ -18,17 +18,21 @@ it('can create queue', () => {
|
|||
|
||||
output = output.map(i => {
|
||||
i._id = null
|
||||
i.date = null
|
||||
return i
|
||||
})
|
||||
expected = expected.map(i => {
|
||||
i._id = null
|
||||
i.date = null
|
||||
return i
|
||||
})
|
||||
|
||||
expect(output).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining(expected[0]),
|
||||
expect.objectContaining(expected[1])
|
||||
expect.objectContaining(expected[1]),
|
||||
expect.objectContaining(expected[2]),
|
||||
expect.objectContaining(expected[3])
|
||||
])
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue