Update bin.test.js
This commit is contained in:
parent
47548cc6d7
commit
4493063d88
|
@ -1,6 +1,7 @@
|
||||||
const { execSync } = require('child_process')
|
const { execSync } = require('child_process')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
const epgParser = require('epg-parser')
|
||||||
|
|
||||||
const pwd = `${__dirname}/..`
|
const pwd = `${__dirname}/..`
|
||||||
|
|
||||||
|
@ -66,14 +67,17 @@ it('removes duplicates of the program', () => {
|
||||||
`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 \
|
||||||
--output=tests/__data__/output/duplicates.guide.xml.gz \
|
--output=tests/__data__/output/duplicates.guide.xml`,
|
||||||
--gzip`,
|
|
||||||
{
|
{
|
||||||
encoding: 'utf8'
|
encoding: 'utf8'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(
|
let output = fs.readFileSync(path.resolve(__dirname, '__data__/output/duplicates.guide.xml'))
|
||||||
fs.readFileSync(path.resolve(__dirname, '__data__/output/duplicates.guide.xml.gz'))
|
let expected = fs.readFileSync(path.resolve(__dirname, '__data__/expected/duplicates.guide.xml'))
|
||||||
).toEqual(fs.readFileSync(path.resolve(__dirname, '__data__/expected/duplicates.guide.xml.gz')))
|
|
||||||
|
output = epgParser.parse(output)
|
||||||
|
expected = epgParser.parse(expected)
|
||||||
|
|
||||||
|
expect(output.programs).toEqual(expected.programs)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue