Update bin.test.js

This commit is contained in:
Aleksandr Statciuk 2023-01-10 11:20:29 +03:00
parent ce4914d9e2
commit c2ea8c7996
1 changed files with 9 additions and 9 deletions

View File

@ -12,18 +12,18 @@ function stdoutResultTester(stdout) {
}
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`,
{
encoding: 'utf8'
}
)
expect(stdoutResultTester(result)).toBe(true)
expect(stdoutResultTester(stdout)).toBe(true)
})
it('can load mini config', () => {
const result = execSync(
const stdout = execSync(
`node ${pwd}/bin/epg-grabber.js \
--config=tests/__data__/input/mini.config.js \
--channels=tests/__data__/input/example.channels.xml \
@ -38,14 +38,14 @@ it('can load mini config', () => {
}
)
expect(stdoutResultTester(result)).toBe(true)
expect(result.includes("File 'tests/__data__/output/mini.guide.xml' successfully saved")).toBe(
expect(stdoutResultTester(stdout)).toBe(true)
expect(stdout.includes("File 'tests/__data__/output/mini.guide.xml' successfully saved")).toBe(
true
)
})
it('can generate gzip version', () => {
const result = execSync(
const stdout = execSync(
`node ${pwd}/bin/epg-grabber.js \
--config=tests/__data__/input/mini.config.js \
--channels=tests/__data__/input/example.channels.xml \
@ -56,14 +56,14 @@ it('can generate gzip version', () => {
}
)
expect(stdoutResultTester(result)).toBe(true)
expect(result.includes("File 'tests/__data__/output/mini.guide.xml.gz' successfully saved")).toBe(
expect(stdoutResultTester(stdout)).toBe(true)
expect(stdout.includes("File 'tests/__data__/output/mini.guide.xml.gz' successfully saved")).toBe(
true
)
})
it('removes duplicates of the program', () => {
const result = execSync(
const stdout = execSync(
`node ${pwd}/bin/epg-grabber.js \
--config=tests/__data__/input/duplicates.config.js \
--channels=tests/__data__/input/example.channels.xml \