mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 02:47:02 -05:00
Update create-queue.js
This commit is contained in:
@@ -58,6 +58,8 @@ async function createQueue() {
|
||||
|
||||
queue = Object.values(queue)
|
||||
|
||||
console.log(queue)
|
||||
|
||||
logger.info(`Found ${queue.length} items`)
|
||||
|
||||
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', () => {
|
||||
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.arrayContaining([
|
||||
expect.objectContaining({
|
||||
lang: 'ru',
|
||||
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
|
||||
})
|
||||
expect.objectContaining(expected[0]),
|
||||
expect.objectContaining(expected[1])
|
||||
])
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user