mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
wip
This commit is contained in:
parent
0a33284308
commit
af41021b99
2 changed files with 2 additions and 2 deletions
|
@ -1,34 +0,0 @@
|
|||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const { execSync } = require('child_process')
|
||||
|
||||
beforeEach(() => {
|
||||
fs.rmdirSync('tests/__data__/output', { recursive: true })
|
||||
fs.mkdirSync('tests/__data__/output')
|
||||
|
||||
execSync(
|
||||
'DB_DIR=tests/__data__/output/database LOGS_DIR=tests/__data__/input/logs node scripts/commands/save-results.js',
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
})
|
||||
|
||||
it('can save results', () => {
|
||||
const output = fs.readFileSync(path.resolve('tests/__data__/output/database/programs.db'), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
const lines = output.split('\n')
|
||||
const parsed = JSON.parse(lines[0])
|
||||
|
||||
expect(Object.keys(parsed).sort()).toEqual([
|
||||
'_id',
|
||||
'category',
|
||||
'channel',
|
||||
'description',
|
||||
'icon',
|
||||
'lang',
|
||||
'site',
|
||||
'start',
|
||||
'stop',
|
||||
'title'
|
||||
])
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue