Update tests

This commit is contained in:
freearhey
2025-04-22 23:17:48 +03:00
parent 88e62715e8
commit 5e8dee13a9
5 changed files with 20 additions and 29 deletions

View File

@@ -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' })
}