Update validate.test.ts

This commit is contained in:
freearhey 2025-07-28 04:37:12 +03:00
parent 8eef3918e5
commit 33e58da0ef
1 changed files with 6 additions and 18 deletions

View File

@ -29,14 +29,9 @@ describe('channels:validate', () => {
})
it('will show a message if the file contains a channel with wrong channel id', () => {
try {
const cmd = `${ENV_VAR} npm run channels:validate --- tests/__data__/input/channels_validate/wrong_channel_id.channels.xml`
const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
process.exit(1)
} catch (error) {
expect((error as ExecError).status).toBe(1)
expect((error as ExecError).stdout).toContain(`
const cmd = `${ENV_VAR} npm run channels:validate --- tests/__data__/input/channels_validate/wrong_channel_id.channels.xml`
const stdout = execSync(cmd, { encoding: 'utf8' })
expect(stdout).toContain(`
(index) type lang xmltv_id site_id name
@ -45,18 +40,12 @@ describe('channels:validate', () => {
1 problems (0 errors, 1 warnings) in 1 file(s)
`)
}
})
it('will show a message if the file contains a channel with wrong feed id', () => {
try {
const cmd = `${ENV_VAR} npm run channels:validate --- tests/__data__/input/channels_validate/wrong_feed_id.channels.xml`
const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
process.exit(1)
} catch (error) {
expect((error as ExecError).status).toBe(1)
expect((error as ExecError).stdout).toContain(`
const cmd = `${ENV_VAR} npm run channels:validate --- tests/__data__/input/channels_validate/wrong_feed_id.channels.xml`
const stdout = execSync(cmd, { encoding: 'utf8' })
expect(stdout).toContain(`
(index) type lang xmltv_id site_id name
@ -65,6 +54,5 @@ describe('channels:validate', () => {
1 problems (0 errors, 1 warnings) in 1 file(s)
`)
}
})
})