mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 02:47:02 -05:00
Create lint.test.js
This commit is contained in:
19
tests/commands/channels/lint.test.js
Normal file
19
tests/commands/channels/lint.test.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
const { execSync } = require('child_process')
|
||||||
|
|
||||||
|
fit('will show a message if the file contains a syntax error', () => {
|
||||||
|
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(
|
||||||
|
`\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`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user