mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Update update.test.js
This commit is contained in:
parent
22935b3eb2
commit
26b6946185
1 changed files with 9 additions and 3 deletions
|
@ -5,11 +5,17 @@ const glob = require('glob')
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fs.emptyDirSync('tests/__data__/output')
|
fs.emptyDirSync('tests/__data__/output')
|
||||||
fs.copyFileSync('tests/__data__/input/database/queue.db', 'tests/__data__/output/queue.db')
|
fs.copyFileSync(
|
||||||
|
'tests/__data__/input/database/update-guides/queue.db',
|
||||||
|
'tests/__data__/output/queue.db'
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can generate /guides', () => {
|
it('can generate /guides', () => {
|
||||||
fs.copyFileSync('tests/__data__/input/database/programs.db', 'tests/__data__/output/programs.db')
|
fs.copyFileSync(
|
||||||
|
'tests/__data__/input/database/update-guides/programs.db',
|
||||||
|
'tests/__data__/output/programs.db'
|
||||||
|
)
|
||||||
const stdout = execSync(
|
const stdout = execSync(
|
||||||
'DB_DIR=tests/__data__/output DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output npm run guides:update',
|
'DB_DIR=tests/__data__/output DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output npm run guides:update',
|
||||||
{ encoding: 'utf8' }
|
{ encoding: 'utf8' }
|
||||||
|
@ -34,7 +40,7 @@ it('can generate /guides', () => {
|
||||||
|
|
||||||
it('will terminate process if programs not found', () => {
|
it('will terminate process if programs not found', () => {
|
||||||
fs.copyFileSync(
|
fs.copyFileSync(
|
||||||
'tests/__data__/input/database/no-programs.db',
|
'tests/__data__/input/database/update-guides/no-programs.db',
|
||||||
'tests/__data__/output/programs.db'
|
'tests/__data__/output/programs.db'
|
||||||
)
|
)
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue