Update bin.test.js
This commit is contained in:
parent
ce4914d9e2
commit
c2ea8c7996
|
@ -12,18 +12,18 @@ function stdoutResultTester(stdout) {
|
||||||
}
|
}
|
||||||
|
|
||||||
it('can load config', () => {
|
it('can load config', () => {
|
||||||
const result = execSync(
|
const stdout = execSync(
|
||||||
`node ${pwd}/bin/epg-grabber.js --config=tests/__data__/input/example.config.js --delay=0`,
|
`node ${pwd}/bin/epg-grabber.js --config=tests/__data__/input/example.config.js --delay=0`,
|
||||||
{
|
{
|
||||||
encoding: 'utf8'
|
encoding: 'utf8'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(stdoutResultTester(result)).toBe(true)
|
expect(stdoutResultTester(stdout)).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can load mini config', () => {
|
it('can load mini config', () => {
|
||||||
const result = execSync(
|
const stdout = execSync(
|
||||||
`node ${pwd}/bin/epg-grabber.js \
|
`node ${pwd}/bin/epg-grabber.js \
|
||||||
--config=tests/__data__/input/mini.config.js \
|
--config=tests/__data__/input/mini.config.js \
|
||||||
--channels=tests/__data__/input/example.channels.xml \
|
--channels=tests/__data__/input/example.channels.xml \
|
||||||
|
@ -38,14 +38,14 @@ it('can load mini config', () => {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(stdoutResultTester(result)).toBe(true)
|
expect(stdoutResultTester(stdout)).toBe(true)
|
||||||
expect(result.includes("File 'tests/__data__/output/mini.guide.xml' successfully saved")).toBe(
|
expect(stdout.includes("File 'tests/__data__/output/mini.guide.xml' successfully saved")).toBe(
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can generate gzip version', () => {
|
it('can generate gzip version', () => {
|
||||||
const result = execSync(
|
const stdout = execSync(
|
||||||
`node ${pwd}/bin/epg-grabber.js \
|
`node ${pwd}/bin/epg-grabber.js \
|
||||||
--config=tests/__data__/input/mini.config.js \
|
--config=tests/__data__/input/mini.config.js \
|
||||||
--channels=tests/__data__/input/example.channels.xml \
|
--channels=tests/__data__/input/example.channels.xml \
|
||||||
|
@ -56,14 +56,14 @@ it('can generate gzip version', () => {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(stdoutResultTester(result)).toBe(true)
|
expect(stdoutResultTester(stdout)).toBe(true)
|
||||||
expect(result.includes("File 'tests/__data__/output/mini.guide.xml.gz' successfully saved")).toBe(
|
expect(stdout.includes("File 'tests/__data__/output/mini.guide.xml.gz' successfully saved")).toBe(
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('removes duplicates of the program', () => {
|
it('removes duplicates of the program', () => {
|
||||||
const result = execSync(
|
const stdout = execSync(
|
||||||
`node ${pwd}/bin/epg-grabber.js \
|
`node ${pwd}/bin/epg-grabber.js \
|
||||||
--config=tests/__data__/input/duplicates.config.js \
|
--config=tests/__data__/input/duplicates.config.js \
|
||||||
--channels=tests/__data__/input/example.channels.xml \
|
--channels=tests/__data__/input/example.channels.xml \
|
||||||
|
|
Loading…
Reference in New Issue