mirror of
https://github.com/iptv-org/epg
synced 2025-12-18 03:16:53 -05:00
Update create-queue.js
This commit is contained in:
@@ -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
|
|
||||||
})
|
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user