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