mirror of
https://github.com/iptv-org/iptv
synced 2025-12-16 10:26:48 -05:00
Update tests
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { pathToFileURL } from 'node:url'
|
||||
import { execSync } from 'child_process'
|
||||
import * as fs from 'fs-extra'
|
||||
import { glob } from 'glob'
|
||||
@@ -24,15 +25,13 @@ describe('playlist:format', () => {
|
||||
.map(f => f.replace('tests/__data__/expected/playlist_format/', ''))
|
||||
|
||||
files.forEach(filepath => {
|
||||
expect(content(`output/streams/${filepath}`), filepath).toBe(
|
||||
content(`expected/playlist_format/${filepath}`)
|
||||
expect(content(`tests/__data__/output/streams/${filepath}`), filepath).toBe(
|
||||
content(`tests/__data__/expected/playlist_format/${filepath}`)
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
function content(filepath: string) {
|
||||
return fs.readFileSync(`tests/__data__/${filepath}`, {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
return fs.readFileSync(pathToFileURL(filepath), { encoding: 'utf8' })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user