mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 08:30:06 -04:00
Update grab.test.ts
This commit is contained in:
parent
a7b80f88a4
commit
3f22ac12f5
1 changed files with 24 additions and 0 deletions
|
@ -97,6 +97,30 @@ describe('epg:grab', () => {
|
|||
|
||||
expect(stdout).toContain('ERR: Connection timeout')
|
||||
})
|
||||
|
||||
it('can grab epg via https proxy', () => {
|
||||
const cmd = `${ENV_VAR} npm run grab --- --site=example.com --proxy=https://bob:123456@proxy.com:1234 --output="${path.resolve(
|
||||
'tests/__data__/output/guide.xml'
|
||||
)}"`
|
||||
const stdout = execSync(cmd, { encoding: 'utf8' })
|
||||
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
|
||||
|
||||
expect(content('tests/__data__/output/guide.xml')).toEqual(
|
||||
content('tests/__data__/expected/guide2.xml')
|
||||
)
|
||||
})
|
||||
|
||||
it('can grab epg via socks5 proxy', () => {
|
||||
const cmd = `${ENV_VAR} npm run grab --- --site=example.com --proxy=socks5://bob:123456@proxy.com:1234 --output="${path.resolve(
|
||||
'tests/__data__/output/guide.xml'
|
||||
)}"`
|
||||
const stdout = execSync(cmd, { encoding: 'utf8' })
|
||||
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
|
||||
|
||||
expect(content('tests/__data__/output/guide.xml')).toEqual(
|
||||
content('tests/__data__/expected/guide2.xml')
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
function content(filepath: string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue