mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 08:30:06 -04:00
Fixes linter issues
This commit is contained in:
parent
60f3604ea5
commit
5b280dfbc8
17 changed files with 2895 additions and 2894 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,36 +1,36 @@
|
|||
import { execSync } from 'child_process'
|
||||
import fs from 'fs-extra'
|
||||
import path from 'path'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
fs.mkdirSync('tests/__data__/output/.sites')
|
||||
fs.copyFileSync(
|
||||
'tests/__data__/input/.sites/config.json',
|
||||
'tests/__data__/output/.sites/config.json'
|
||||
)
|
||||
fs.copyFileSync(
|
||||
'tests/__data__/input/.sites/template.md',
|
||||
'tests/__data__/output/.sites/template.md'
|
||||
)
|
||||
})
|
||||
|
||||
it('can update SITES.md', () => {
|
||||
const stdout = execSync('DOT_SITES_DIR=tests/__data__/output/.sites npm run sites:update', {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
|
||||
expect(content('tests/__data__/output/sites.md')).toEqual(
|
||||
content('tests/__data__/expected/_sites.md')
|
||||
)
|
||||
|
||||
expect(true).toBe(true)
|
||||
})
|
||||
|
||||
function content(filepath: string) {
|
||||
const data = fs.readFileSync(path.resolve(filepath), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
|
||||
return JSON.stringify(data)
|
||||
}
|
||||
import { execSync } from 'child_process'
|
||||
import fs from 'fs-extra'
|
||||
import path from 'path'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
fs.mkdirSync('tests/__data__/output/.sites')
|
||||
fs.copyFileSync(
|
||||
'tests/__data__/input/.sites/config.json',
|
||||
'tests/__data__/output/.sites/config.json'
|
||||
)
|
||||
fs.copyFileSync(
|
||||
'tests/__data__/input/.sites/template.md',
|
||||
'tests/__data__/output/.sites/template.md'
|
||||
)
|
||||
})
|
||||
|
||||
it('can update SITES.md', () => {
|
||||
execSync('DOT_SITES_DIR=tests/__data__/output/.sites npm run sites:update', {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
|
||||
expect(content('tests/__data__/output/sites.md')).toEqual(
|
||||
content('tests/__data__/expected/_sites.md')
|
||||
)
|
||||
|
||||
expect(true).toBe(true)
|
||||
})
|
||||
|
||||
function content(filepath: string) {
|
||||
const data = fs.readFileSync(path.resolve(filepath), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
|
||||
return JSON.stringify(data)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue