mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update update.test.js
This commit is contained in:
parent
ba88448119
commit
1a8e256aab
1 changed files with 32 additions and 2 deletions
|
@ -9,14 +9,44 @@ beforeEach(() => {
|
||||||
'tests/__data__/input/database/update-guides/programs.db',
|
'tests/__data__/input/database/update-guides/programs.db',
|
||||||
'tests/__data__/output/programs.db'
|
'tests/__data__/output/programs.db'
|
||||||
)
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('can generate /guides', () => {
|
||||||
const stdout = execSync(
|
const stdout = execSync(
|
||||||
'DB_DIR=tests/__data__/output LOGS_DIR=tests/__data__/output/logs DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output CURR_DATE=2022-10-20 npm run guides:update',
|
'DB_DIR=tests/__data__/output LOGS_DIR=tests/__data__/output/logs DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output CURR_DATE=2022-10-20 npm run guides:update',
|
||||||
{ encoding: 'utf8' }
|
{ encoding: 'utf8' }
|
||||||
)
|
)
|
||||||
})
|
|
||||||
|
|
||||||
it('can generate /guides', () => {
|
expect(stdout).toBe(
|
||||||
|
`
|
||||||
|
> guides:update
|
||||||
|
> NODE_OPTIONS=--max-old-space-size=5120 node scripts/commands/guides/update.js
|
||||||
|
|
||||||
|
starting...
|
||||||
|
loading data/countries.json...
|
||||||
|
loading data/channels.json...
|
||||||
|
loading data/regions.json...
|
||||||
|
loading data/subdivisions.json...
|
||||||
|
loading database/programs.db...
|
||||||
|
found 5 programs
|
||||||
|
creating tests/__data__/output/guides/dk.xml...
|
||||||
|
creating tests/__data__/output/guides/dk.xml.gz...
|
||||||
|
creating tests/__data__/output/guides/dk.json...
|
||||||
|
creating tests/__data__/output/guides/uk.xml...
|
||||||
|
creating tests/__data__/output/guides/uk.xml.gz...
|
||||||
|
creating tests/__data__/output/guides/uk.json...
|
||||||
|
creating tests/__data__/output/logs/guides/update.log...
|
||||||
|
|
||||||
|
report:
|
||||||
|
┌─────────┬────────────┬───────────┬──────┬──────────┬────────────────┬───────────┐
|
||||||
|
│ (index) │ type │ site │ lang │ channel │ broadcast_area │ languages │
|
||||||
|
├─────────┼────────────┼───────────┼──────┼──────────┼────────────────┼───────────┤
|
||||||
|
│ 0 │ 'no_guide' │ 'sky.com' │ 'fr' │ 'CNN.us' │ [ 'c/US' ] │ [ 'eng' ] │
|
||||||
|
└─────────┴────────────┴───────────┴──────┴──────────┴────────────────┴───────────┘
|
||||||
|
found 1 error(s)
|
||||||
|
`
|
||||||
|
)
|
||||||
|
|
||||||
const uncompressed = glob
|
const uncompressed = glob
|
||||||
.sync('tests/__data__/expected/guides/*.xml')
|
.sync('tests/__data__/expected/guides/*.xml')
|
||||||
.map(f => f.replace('tests/__data__/expected/', ''))
|
.map(f => f.replace('tests/__data__/expected/', ''))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue