mirror of
https://github.com/iptv-org/epg
synced 2026-07-03 13:47:11 -04:00
Update tests
This commit is contained in:
@@ -2,6 +2,8 @@ import { execSync } from 'child_process'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
import fs from 'fs-extra'
|
||||
|
||||
const ENV_VAR = 'cross-env DATA_DIR=tests/__data__/input/data'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
fs.copySync(
|
||||
@@ -12,7 +14,7 @@ beforeEach(() => {
|
||||
|
||||
describe('channels:format', () => {
|
||||
it('can format *.channels.xml files', () => {
|
||||
const cmd = 'npm run channels:format --- tests/__data__/output/example.com.channels.xml'
|
||||
const cmd = `${ENV_VAR} npm run channels:format --- tests/__data__/output/example.com.channels.xml`
|
||||
const stdout = execSync(cmd, { encoding: 'utf8' })
|
||||
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import fs from 'fs-extra'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
|
||||
const ENV_VAR =
|
||||
'cross-env SITES_DIR=tests/__data__/input/guides_export/sites API_DIR=tests/__data__/output'
|
||||
'cross-env SITES_DIR=tests/__data__/input/guides_export/sites DATA_DIR=tests/__data__/input/data API_DIR=tests/__data__/output'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
|
||||
Reference in New Issue
Block a user