mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Fixes linter errors
This commit is contained in:
parent
57e508fc3b
commit
63c86a2b30
393 changed files with 28447 additions and 28443 deletions
|
@ -1,39 +1,39 @@
|
|||
import { execSync } from 'child_process'
|
||||
import fs from 'fs-extra'
|
||||
import path from 'path'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
fs.copySync(
|
||||
'tests/__data__/input/channels-parse/channels-parse.channels.xml',
|
||||
'tests/__data__/output/channels.xml'
|
||||
)
|
||||
})
|
||||
|
||||
describe('channels:parse', () => {
|
||||
it('can parse channels', () => {
|
||||
const cmd =
|
||||
'npm run channels:parse -- --config=tests/__data__/input/channels-parse/channels-parse.config.js --output=tests/__data__/output/channels.xml'
|
||||
execSync(cmd, { encoding: 'utf8' })
|
||||
|
||||
expect(content('tests/__data__/output/channels.xml')).toEqual(
|
||||
content('tests/__data__/expected/sites/channels-parse/channels-parse.channels.xml')
|
||||
)
|
||||
})
|
||||
|
||||
it('can parse channels with clean flag', () => {
|
||||
const cmd =
|
||||
'npm run channels:parse -- --config=tests/__data__/input/channels-parse/channels-parse.config.js --output=tests/__data__/output/channels.xml --clean'
|
||||
execSync(cmd, { encoding: 'utf8' })
|
||||
|
||||
expect(content('tests/__data__/output/channels.xml')).toEqual(
|
||||
content('tests/__data__/expected/sites/channels-parse/channels-parse-clean.channels.xml')
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
function content(filepath: string) {
|
||||
return fs.readFileSync(path.resolve(filepath), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
}
|
||||
import { execSync } from 'child_process'
|
||||
import fs from 'fs-extra'
|
||||
import path from 'path'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
fs.copySync(
|
||||
'tests/__data__/input/channels-parse/channels-parse.channels.xml',
|
||||
'tests/__data__/output/channels.xml'
|
||||
)
|
||||
})
|
||||
|
||||
describe('channels:parse', () => {
|
||||
it('can parse channels', () => {
|
||||
const cmd =
|
||||
'npm run channels:parse -- --config=tests/__data__/input/channels-parse/channels-parse.config.js --output=tests/__data__/output/channels.xml'
|
||||
execSync(cmd, { encoding: 'utf8' })
|
||||
|
||||
expect(content('tests/__data__/output/channels.xml')).toEqual(
|
||||
content('tests/__data__/expected/sites/channels-parse/channels-parse.channels.xml')
|
||||
)
|
||||
})
|
||||
|
||||
it('can parse channels with clean flag', () => {
|
||||
const cmd =
|
||||
'npm run channels:parse -- --config=tests/__data__/input/channels-parse/channels-parse.config.js --output=tests/__data__/output/channels.xml --clean'
|
||||
execSync(cmd, { encoding: 'utf8' })
|
||||
|
||||
expect(content('tests/__data__/output/channels.xml')).toEqual(
|
||||
content('tests/__data__/expected/sites/channels-parse/channels-parse-clean.channels.xml')
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
function content(filepath: string) {
|
||||
return fs.readFileSync(path.resolve(filepath), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue