Files
epg/tests/commands/channels/lint.test.js

20 lines
666 B
JavaScript
Raw Normal View History

2022-02-27 18:04:56 +03:00
const { execSync } = require('child_process')
2022-02-28 12:29:27 +03:00
it('will show a message if the file contains a syntax error', () => {
2022-02-27 18:04:56 +03:00
try {
const stdout = execSync(
'npm run channels:lint -- tests/__data__/input/sites/lint.channels.xml',
{
encoding: 'utf8'
}
)
console.log(stdout)
process.exit(1)
} catch (err) {
expect(err.status).toBe(1)
expect(err.stdout).toBe(
2023-05-15 19:12:12 +03:00
`\n> channels:lint\n> node scripts/commands/channels/lint.js tests/__data__/input/sites/lint.channels.xml\n\n\ntests/__data__/input/sites/lint.channels.xml\n 4:0 Element 'channel': The attribute 'lang' is required but missing.\n\n1 error(s)\n`
2022-02-27 18:04:56 +03:00
)
}
})