mirror of
https://github.com/iptv-org/iptv.git
synced 2026-11-09 01:42:51 +02:00
test: let playlist:update test fail on mismatched output
The assertions sat inside a try/catch whose catch only logged, so a failed expect was swallowed and the test always passed. That hid a stale fixture: since issue #39098 was added to the input issues, the command closes it (the expected uk.m3u already shows the edit), but playlist_update.log was never updated.
This commit is contained in:
@@ -1 +1 @@
|
||||
closes #14175, closes #14105, closes #14104, closes #14057, closes #14034, closes #13964, closes #13893, closes #13881, closes #13793, closes #13751, closes #13715, closes #14110, closes #14121, closes #14151, closes #14150, closes #39097
|
||||
closes #14175, closes #14105, closes #14104, closes #14057, closes #14034, closes #13964, closes #13893, closes #13881, closes #13793, closes #13751, closes #13715, closes #14110, closes #14121, closes #14151, closes #14150, closes #39097, closes #39098
|
||||
@@ -16,33 +16,29 @@ describe('playlist:update', () => {
|
||||
it('can update playlists', async () => {
|
||||
let cmd = `${ENV_VAR} npm run playlist:update`
|
||||
if (!process.env.DEBUG) cmd += ' --silent'
|
||||
try {
|
||||
const stdout = execSync(cmd, { encoding: 'utf8' })
|
||||
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
|
||||
const stdout = execSync(cmd, { encoding: 'utf8' })
|
||||
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
|
||||
|
||||
const files = glob
|
||||
.sync('tests/__data__/expected/playlist_update/streams/*.m3u')
|
||||
.map(filepath => {
|
||||
const fileUrl = pathToFileURL(filepath).toString()
|
||||
const pathToRemove = pathToFileURL(
|
||||
'tests/__data__/expected/playlist_update/streams/'
|
||||
).toString()
|
||||
const files = glob
|
||||
.sync('tests/__data__/expected/playlist_update/streams/*.m3u')
|
||||
.map(filepath => {
|
||||
const fileUrl = pathToFileURL(filepath).toString()
|
||||
const pathToRemove = pathToFileURL(
|
||||
'tests/__data__/expected/playlist_update/streams/'
|
||||
).toString()
|
||||
|
||||
return fileUrl.replace(pathToRemove, '')
|
||||
})
|
||||
|
||||
files.forEach(filepath => {
|
||||
expect(content(`tests/__data__/output/streams/${filepath}`)).toBe(
|
||||
content(`tests/__data__/expected/playlist_update/streams/${filepath}`)
|
||||
)
|
||||
return fileUrl.replace(pathToRemove, '')
|
||||
})
|
||||
|
||||
expect(content('tests/__data__/output/logs/playlist_update.log')).toBe(
|
||||
content('tests/__data__/expected/playlist_update/playlist_update.log')
|
||||
files.forEach(filepath => {
|
||||
expect(content(`tests/__data__/output/streams/${filepath}`)).toBe(
|
||||
content(`tests/__data__/expected/playlist_update/streams/${filepath}`)
|
||||
)
|
||||
} catch (err) {
|
||||
if (process.env.DEBUG === 'true') console.log(cmd, err.stdout)
|
||||
}
|
||||
})
|
||||
|
||||
expect(content('tests/__data__/output/logs/playlist_update.log')).toBe(
|
||||
content('tests/__data__/expected/playlist_update/playlist_update.log')
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user