Update bin.test.js

This commit is contained in:
Aleksandr Statciuk 2021-11-18 17:31:54 +03:00
parent a640814b6d
commit f1d02c9d62
1 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,8 @@
const { execSync } = require('child_process')
const pwd = `${__dirname}/..`
import axios from 'axios'
jest.mock('axios')
function stdoutResultTester(stdout) {
return [`Finish`].every(val => {
@ -19,6 +22,8 @@ it('can load config', () => {
})
it('can load mini config', () => {
axios.mockImplementation(() => Promise.resolve({ data: '' }))
const result = execSync(
`node ${pwd}/bin/epg-grabber.js \
--config=tests/input/mini.config.js \
@ -26,7 +31,8 @@ it('can load mini config', () => {
--output=tests/output/mini.guide.xml \
--lang=fr \
--days=3 \
--delay=0`,
--delay=0 \
--timeout=10000`,
{
encoding: 'utf8'
}