mirror of
https://github.com/iptv-org/iptv
synced 2025-12-16 10:26:48 -05:00
Update update.test.ts
This commit is contained in:
@@ -2,19 +2,11 @@ import { pathToFileURL } from 'node:url'
|
|||||||
import { execSync } from 'child_process'
|
import { execSync } from 'child_process'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
const ENV_VAR = 'cross-env DATA_DIR=tests/__data__/input/data LOGS_DIR=tests/__data__/input/readme_update README_DIR=tests/__data__/output/.readme'
|
const ENV_VAR =
|
||||||
|
'cross-env DATA_DIR=tests/__data__/input/data LOGS_DIR=tests/__data__/input/readme_update ROOT_DIR=tests/__data__/output'
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fs.emptyDirSync('tests/__data__/output')
|
fs.emptyDirSync('tests/__data__/output')
|
||||||
fs.mkdirSync('tests/__data__/output/.readme')
|
|
||||||
fs.copyFileSync(
|
|
||||||
'tests/__data__/input/readme_update/.readme/config.json',
|
|
||||||
'tests/__data__/output/.readme/config.json'
|
|
||||||
)
|
|
||||||
fs.copyFileSync(
|
|
||||||
'tests/__data__/input/readme_update/.readme/template.md',
|
|
||||||
'tests/__data__/output/.readme/template.md'
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('readme:update', () => {
|
describe('readme:update', () => {
|
||||||
@@ -23,8 +15,8 @@ describe('readme:update', () => {
|
|||||||
const stdout = execSync(cmd, { encoding: 'utf8' })
|
const stdout = execSync(cmd, { encoding: 'utf8' })
|
||||||
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
|
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
|
||||||
|
|
||||||
expect(content('tests/__data__/output/playlists.md')).toEqual(
|
expect(content('tests/__data__/output/PLAYLISTS.md')).toEqual(
|
||||||
content('tests/__data__/expected/readme_update/playlists.md')
|
content('tests/__data__/expected/readme_update/PLAYLISTS.md')
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user