mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
wip
This commit is contained in:
parent
cea7fc2cbb
commit
cfdf85bd01
7 changed files with 199 additions and 161 deletions
21
tests/commands/generate-guides.test.js
Normal file
21
tests/commands/generate-guides.test.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
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')
|
||||
fs.mkdirSync('tests/__data__/output/api')
|
||||
})
|
||||
|
||||
it('can generate channels.json', () => {
|
||||
const result = execSync(
|
||||
'PUBLIC_DIR=tests/__data__/output DB_DIR=tests/__data__/input/database node scripts/commands/generate-guides.js',
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
const json = fs.readFileSync(path.resolve('tests/__data__/output/api/channels.json'), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
const parsed = JSON.parse(json)
|
||||
expect(parsed[0]).toMatchObject({})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue