mirror of
https://github.com/iptv-org/iptv
synced 2026-11-26 19:14:43 -05: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:
2 files changed
+19
-23
No files matched your search
@@ -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 () => {
|
it('can update playlists', async () => {
|
||||||
let cmd = `${ENV_VAR} npm run playlist:update`
|
let cmd = `${ENV_VAR} npm run playlist:update`
|
||||||
if (!process.env.DEBUG) cmd += ' --silent'
|
if (!process.env.DEBUG) cmd += ' --silent'
|
||||||
try {
|
const stdout = execSync(cmd, { encoding: 'utf8' })
|
||||||
const stdout = execSync(cmd, { encoding: 'utf8' })
|
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
|
||||||
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
|
|
||||||
|
|
||||||
const files = glob
|
const files = glob
|
||||||
.sync('tests/__data__/expected/playlist_update/streams/*.m3u')
|
.sync('tests/__data__/expected/playlist_update/streams/*.m3u')
|
||||||
.map(filepath => {
|
.map(filepath => {
|
||||||
const fileUrl = pathToFileURL(filepath).toString()
|
const fileUrl = pathToFileURL(filepath).toString()
|
||||||
const pathToRemove = pathToFileURL(
|
const pathToRemove = pathToFileURL(
|
||||||
'tests/__data__/expected/playlist_update/streams/'
|
'tests/__data__/expected/playlist_update/streams/'
|
||||||
).toString()
|
).toString()
|
||||||
|
|
||||||
return fileUrl.replace(pathToRemove, '')
|
return fileUrl.replace(pathToRemove, '')
|
||||||
})
|
|
||||||
|
|
||||||
files.forEach(filepath => {
|
|
||||||
expect(content(`tests/__data__/output/streams/${filepath}`)).toBe(
|
|
||||||
content(`tests/__data__/expected/playlist_update/streams/${filepath}`)
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(content('tests/__data__/output/logs/playlist_update.log')).toBe(
|
files.forEach(filepath => {
|
||||||
content('tests/__data__/expected/playlist_update/playlist_update.log')
|
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