mirror of
https://github.com/iptv-org/iptv
synced 2025-12-16 02:16:47 -05:00
Fix errors found by linter
This commit is contained in:
@@ -4,14 +4,14 @@ import fs from 'fs-extra'
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
|
||||
const stdout = execSync(
|
||||
execSync(
|
||||
'STREAMS_DIR=tests/__data__/input/streams_generate API_DIR=tests/__data__/output/.api npm run api:generate',
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
})
|
||||
|
||||
it('can create streams.json', () => {
|
||||
expect(content(`output/.api/streams.json`)).toMatchObject(content(`expected/.api/streams.json`))
|
||||
expect(content('output/.api/streams.json')).toMatchObject(content('expected/.api/streams.json'))
|
||||
})
|
||||
|
||||
function content(filepath: string) {
|
||||
|
||||
@@ -8,7 +8,7 @@ beforeEach(() => {
|
||||
})
|
||||
|
||||
it('can format playlists', () => {
|
||||
const stdout = execSync('STREAMS_DIR=tests/__data__/output/streams npm run playlist:format', {
|
||||
execSync('STREAMS_DIR=tests/__data__/output/streams npm run playlist:format', {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as glob from 'glob'
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
|
||||
const stdout = execSync(
|
||||
execSync(
|
||||
'STREAMS_DIR=tests/__data__/input/streams_generate DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output/.gh-pages LOGS_DIR=tests/__data__/output/logs npm run playlist:generate',
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
@@ -20,8 +20,8 @@ it('can generate playlists and logs', () => {
|
||||
expect(content(`output/${filepath}`), filepath).toBe(content(`expected/${filepath}`))
|
||||
})
|
||||
|
||||
expect(content(`output/logs/generators.log`).split('\n').sort()).toStrictEqual(
|
||||
content(`expected/logs/generators.log`).split('\n').sort()
|
||||
expect(content('output/logs/generators.log').split('\n').sort()).toStrictEqual(
|
||||
content('expected/logs/generators.log').split('\n').sort()
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ it('can format playlists', () => {
|
||||
})
|
||||
|
||||
expect(stdout).toBe(
|
||||
`OUTPUT=closes #14151, closes #14140, closes #14139, closes #14110, closes #14179, closes #14178\n`
|
||||
'OUTPUT=closes #14151, closes #14140, closes #14139, closes #14110, closes #14179, closes #14178\n'
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -10,11 +10,13 @@ it('show an error if channel name in the blocklist', () => {
|
||||
)
|
||||
console.log(stdout)
|
||||
process.exit(1)
|
||||
} catch (error: any) {
|
||||
} catch (error: unknown) {
|
||||
// @ts-ignore
|
||||
expect(error.status).toBe(1)
|
||||
expect(
|
||||
// @ts-ignore
|
||||
error.stdout.includes(
|
||||
`us_blocked.m3u\n 2 error "Fox Sports 2 Asia (Thai)" is on the blocklist due to claims of copyright holders (https://github.com/iptv-org/iptv/issues/0000)\n\n1 problems (1 errors, 0 warnings)\n`
|
||||
'us_blocked.m3u\n 2 error "Fox Sports 2 Asia (Thai)" is on the blocklist due to claims of copyright holders (https://github.com/iptv-org/iptv/issues/0000)\n\n1 problems (1 errors, 0 warnings)\n'
|
||||
)
|
||||
).toBe(true)
|
||||
}
|
||||
@@ -30,7 +32,7 @@ it('show a warning if channel has wrong id', () => {
|
||||
|
||||
expect(
|
||||
stdout.includes(
|
||||
`wrong_id.m3u\n 2 warning "qib22lAq1L.us" is not in the database\n\n1 problems (0 errors, 1 warnings)\n`
|
||||
'wrong_id.m3u\n 2 warning "qib22lAq1L.us" is not in the database\n\n1 problems (0 errors, 1 warnings)\n'
|
||||
)
|
||||
).toBe(true)
|
||||
})
|
||||
|
||||
@@ -14,7 +14,7 @@ beforeEach(() => {
|
||||
'tests/__data__/output/.readme/template.md'
|
||||
)
|
||||
|
||||
const stdout = execSync(
|
||||
execSync(
|
||||
'DATA_DIR=tests/__data__/input/data LOGS_DIR=tests/__data__/input/logs README_DIR=tests/__data__/output/.readme npm run readme:update',
|
||||
{ encoding: 'utf8' }
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user