Skip to content

Commit

Permalink
Update grab.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
freearhey committed Jan 6, 2025
1 parent 0b8782a commit bb9248d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/commands/epg/grab.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('epg:grab', () => {
'tests/__data__/output/guide.xml'
)}"`
const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(stdout)
if (process.env.DEBUG === 'true') console.log(cmd, stdout)

expect(content('tests/__data__/output/guide.xml')).toEqual(
content('tests/__data__/expected/guide2.xml')
Expand All @@ -32,7 +32,7 @@ describe('epg:grab', () => {
it('can grab epg with multiple channels.xml files', () => {
const cmd = `${ENV_VAR} npm run grab --- --channels=tests/__data__/input/epg-grab/sites/**/*.channels.xml --output=tests/__data__/output/guide.xml`
const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(stdout)
if (process.env.DEBUG === 'true') console.log(cmd, stdout)

expect(content('tests/__data__/output/guide.xml')).toEqual(
content('tests/__data__/expected/guide.xml')
Expand All @@ -44,7 +44,7 @@ describe('epg:grab', () => {
'tests/__data__/output/guide.xml'
)}" --gzip`
const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(stdout)
if (process.env.DEBUG === 'true') console.log(cmd, stdout)

expect(content('tests/__data__/output/guide.xml')).toEqual(
content('tests/__data__/expected/guide.xml')
Expand All @@ -59,7 +59,7 @@ describe('epg:grab', () => {
it('can grab epg with wildcard as output', () => {
const cmd = `${ENV_VAR} npm run grab --- --channels=tests/__data__/input/epg-grab/sites/example.com/example.com.channels.xml --output=tests/__data__/output/guides/{lang}/{site}.xml`
const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(stdout)
if (process.env.DEBUG === 'true') console.log(cmd, stdout)

expect(content('tests/__data__/output/guides/en/example.com.xml')).toEqual(
content('tests/__data__/expected/guides/en/example.com.xml')
Expand All @@ -73,7 +73,7 @@ describe('epg:grab', () => {
it('can grab epg then language filter enabled', () => {
const cmd = `${ENV_VAR} npm run grab --- --channels=tests/__data__/input/epg-grab/sites/example.com/example.com.channels.xml --output=tests/__data__/output/guides/{lang}/{site}.xml --lang=fr`
const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(stdout)
if (process.env.DEBUG === 'true') console.log(cmd, stdout)

expect(content('tests/__data__/output/guides/fr/example.com.xml')).toEqual(
content('tests/__data__/expected/guides/fr/example.com.xml')
Expand All @@ -83,7 +83,7 @@ describe('epg:grab', () => {
it('can grab epg using custom channels list', () => {
const cmd = `${ENV_VAR} npm run grab --- --channels=tests/__data__/input/epg-grab/custom.channels.xml --output=tests/__data__/output/guide.xml`
const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(stdout)
if (process.env.DEBUG === 'true') console.log(cmd, stdout)

expect(content('tests/__data__/output/guide.xml')).toEqual(
content('tests/__data__/expected/guide.xml')
Expand All @@ -93,7 +93,7 @@ describe('epg:grab', () => {
it('it will raise an error if the timeout is exceeded', () => {
const cmd = `${ENV_VAR} npm run grab --- --channels=tests/__data__/input/epg-grab/custom.channels.xml --output=tests/__data__/output/guide.xml --timeout=0`
const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(stdout)
if (process.env.DEBUG === 'true') console.log(cmd, stdout)

expect(stdout).toContain('ERR: Connection timeout')
})
Expand Down

0 comments on commit bb9248d

Please sign in to comment.