mirror of
https://github.com/iptv-org/epg
synced 2025-12-16 10:26:41 -05:00
Update grab.test.ts
This commit is contained in:
@@ -99,16 +99,24 @@ describe('epg:grab', () => {
|
||||
content('tests/__data__/expected/epg_grab/gzip.guide.xml')
|
||||
)
|
||||
|
||||
const expected = pako.ungzip(fs.readFileSync('tests/__data__/output/guides/gzip.guide.xml.gz'))
|
||||
const result = pako.ungzip(
|
||||
fs.readFileSync('tests/__data__/expected/epg_grab/gzip.guide.xml.gz')
|
||||
const outputString = pako.ungzip(
|
||||
fs.readFileSync('tests/__data__/output/guides/gzip.guide.xml.gz'),
|
||||
{ to: 'string' }
|
||||
)
|
||||
expect(expected).toEqual(result)
|
||||
const expectedString = pako.ungzip(
|
||||
fs.readFileSync('tests/__data__/expected/epg_grab/gzip.guide.xml.gz'),
|
||||
{ to: 'string' }
|
||||
)
|
||||
|
||||
const output = new Set(outputString.split('\r\n'))
|
||||
const expected = new Set(expectedString.split('\r\n'))
|
||||
|
||||
expect(output).toEqual(expected)
|
||||
})
|
||||
})
|
||||
|
||||
function content(filepath: string) {
|
||||
return fs.readFileSync(pathToFileURL(filepath), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
const string = fs.readFileSync(pathToFileURL(filepath), 'utf8')
|
||||
|
||||
return new Set(string.split('\r\n'))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user