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
12340986d8
commit
957ccff392
6 changed files with 13 additions and 32 deletions
|
@ -3,7 +3,9 @@ const path = require('path')
|
|||
const { execSync } = require('child_process')
|
||||
|
||||
beforeEach(() => {
|
||||
fs.copyFileSync('tests/__data__/input/test.db', 'tests/__data__/temp/test.db')
|
||||
fs.rmdirSync('tests/__data__/output', { recursive: true })
|
||||
fs.mkdirSync('tests/__data__/output')
|
||||
fs.copyFileSync('tests/__data__/input/channels.db', 'tests/__data__/temp/channels.db')
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -12,9 +14,8 @@ afterEach(() => {
|
|||
})
|
||||
|
||||
it('can create valid matrix', () => {
|
||||
const result = execSync(
|
||||
'DB_FILEPATH=tests/__data__/temp/test.db node scripts/commands/create-matrix.js',
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
const result = execSync('DB_DIR=tests/__data__/temp node scripts/commands/create-matrix.js', {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
expect(result).toBe('::set-output name=matrix::{"cluster_id":[1]}\n')
|
||||
})
|
||||
|
|
|
@ -5,15 +5,16 @@ const { execSync } = require('child_process')
|
|||
beforeEach(() => {
|
||||
fs.rmdirSync('tests/__data__/output', { recursive: true })
|
||||
fs.mkdirSync('tests/__data__/output')
|
||||
fs.copyFileSync('tests/__data__/input/programs.db', 'tests/__data__/output/programs.db')
|
||||
fs.mkdirSync('tests/__data__/output/database')
|
||||
fs.copyFileSync('tests/__data__/input/programs.db', 'tests/__data__/output/database/programs.db')
|
||||
})
|
||||
|
||||
it('can save results', () => {
|
||||
const result = execSync(
|
||||
'DB_DIR=tests/__data__/output LOGS_PATH=tests/__data__/input/logs node scripts/commands/save-results.js',
|
||||
'DB_DIR=tests/__data__/output/database LOGS_PATH=tests/__data__/input/logs node scripts/commands/save-results.js',
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
const logs = fs.readFileSync(path.resolve('tests/__data__/output/programs.db'), {
|
||||
const logs = fs.readFileSync(path.resolve('tests/__data__/output/database/programs.db'), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
const lines = logs.split('\n')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue