mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update create-queue.js
This commit is contained in:
parent
0161ac02d0
commit
309294988b
3 changed files with 17 additions and 19 deletions
|
@ -58,6 +58,8 @@ async function createQueue() {
|
||||||
|
|
||||||
queue = Object.values(queue)
|
queue = Object.values(queue)
|
||||||
|
|
||||||
|
console.log(queue)
|
||||||
|
|
||||||
logger.info(`Found ${queue.length} items`)
|
logger.info(`Found ${queue.length} items`)
|
||||||
|
|
||||||
return queue
|
return queue
|
||||||
|
|
2
tests/__data__/expected/database/queue.db
Normal file
2
tests/__data__/expected/database/queue.db
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{"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"}
|
|
@ -13,28 +13,22 @@ beforeEach(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can create queue', () => {
|
it('can create queue', () => {
|
||||||
const output = content('tests/__data__/output/database/queue.db')
|
let output = content('tests/__data__/output/database/queue.db')
|
||||||
|
let expected = content('tests/__data__/expected/database/queue.db')
|
||||||
|
|
||||||
|
output = output.map(i => {
|
||||||
|
i._id = null
|
||||||
|
return i
|
||||||
|
})
|
||||||
|
expected = expected.map(i => {
|
||||||
|
i._id = null
|
||||||
|
return i
|
||||||
|
})
|
||||||
|
|
||||||
expect(output).toEqual(
|
expect(output).toEqual(
|
||||||
expect.arrayContaining([
|
expect.arrayContaining([
|
||||||
expect.objectContaining({
|
expect.objectContaining(expected[0]),
|
||||||
lang: 'ru',
|
expect.objectContaining(expected[1])
|
||||||
xmltv_id: 'CNNInternationalEurope.us',
|
|
||||||
site_id: '140',
|
|
||||||
site: 'example.com',
|
|
||||||
configPath: 'tests/__data__/input/sites/example.com.config.js',
|
|
||||||
groups: ['ca-nl/example.com'],
|
|
||||||
cluster_id: 1
|
|
||||||
}),
|
|
||||||
expect.objectContaining({
|
|
||||||
lang: 'en',
|
|
||||||
xmltv_id: 'CNNInternationalEurope2.us',
|
|
||||||
site_id: '141',
|
|
||||||
site: 'example.com',
|
|
||||||
configPath: 'tests/__data__/input/sites/example.com.config.js',
|
|
||||||
groups: ['ca-nl/example.com'],
|
|
||||||
cluster_id: 1
|
|
||||||
})
|
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue