mirror of
https://github.com/iptv-org/epg
synced 2026-04-24 11:37:02 -04:00
Update deps + configuration
Prevent usage of old dependencies & update the whole structure.
This commit is contained in:
@@ -17,5 +17,5 @@ npm run channels:parse --- --config=./sites/example.com/example.com.config.js --
|
||||
### Test
|
||||
|
||||
```sh
|
||||
npm test --- example.com
|
||||
npm run test:site example.com
|
||||
```
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
import { execSync } from 'child_process'
|
||||
import fs from 'fs-extra'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
import os from 'os'
|
||||
|
||||
let ENV_VAR = 'SITES_DIR=tests/__data__/input/api_generate/sites API_DIR=tests/__data__/output'
|
||||
if (os.platform() === 'win32') {
|
||||
ENV_VAR =
|
||||
'SET "SITES_DIR=tests/__data__/input/api_generate/sites" && SET "API_DIR=tests/__data__/output" &&'
|
||||
}
|
||||
const ENV_VAR = 'cross-env SITES_DIR=tests/__data__/input/api_generate/sites API_DIR=tests/__data__/output'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
import { execSync } from 'child_process'
|
||||
import fs from 'fs-extra'
|
||||
import os from 'os'
|
||||
|
||||
type ExecError = {
|
||||
status: number
|
||||
stdout: string
|
||||
}
|
||||
|
||||
let ENV_VAR = 'DATA_DIR=tests/__data__/input/__data__'
|
||||
if (os.platform() === 'win32') {
|
||||
ENV_VAR = 'SET "DATA_DIR=tests/__data__/input/__data__" &&'
|
||||
}
|
||||
const ENV_VAR = 'cross-env DATA_DIR=tests/__data__/input/__data__'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
@@ -27,10 +18,12 @@ describe('channels:edit', () => {
|
||||
const stdout = execSync(cmd, { encoding: 'utf8' })
|
||||
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
|
||||
checkStdout(stdout)
|
||||
} catch (error) {
|
||||
} catch (error: unknown) {
|
||||
// NOTE: for Windows only
|
||||
if (process.env.DEBUG === 'true') console.log(cmd, error)
|
||||
checkStdout((error as ExecError).stdout)
|
||||
if (error && typeof error === 'object' && 'stdout' in error) {
|
||||
checkStdout(error.stdout as string)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
import { execSync } from 'child_process'
|
||||
import os from 'os'
|
||||
|
||||
type ExecError = {
|
||||
status: number
|
||||
stdout: string
|
||||
}
|
||||
|
||||
let ENV_VAR = 'DATA_DIR=tests/__data__/input/__data__'
|
||||
if (os.platform() === 'win32') {
|
||||
ENV_VAR = 'SET "DATA_DIR=tests/__data__/input/__data__" &&'
|
||||
}
|
||||
const ENV_VAR = 'cross-env DATA_DIR=tests/__data__/input/__data__'
|
||||
|
||||
describe('channels:validate', () => {
|
||||
it('will show a message if the file contains a duplicate', () => {
|
||||
|
||||
@@ -3,14 +3,8 @@ import { execSync } from 'child_process'
|
||||
import { Zip } from '@freearhey/core'
|
||||
import fs from 'fs-extra'
|
||||
import path from 'path'
|
||||
import os from 'os'
|
||||
|
||||
let ENV_VAR =
|
||||
'SITES_DIR=tests/__data__/input/epg_grab/sites CURR_DATE=2022-10-20 DATA_DIR=tests/__data__/input/__data__'
|
||||
if (os.platform() === 'win32') {
|
||||
ENV_VAR =
|
||||
'SET "SITES_DIR=tests/__data__/input/epg_grab/sites" && SET "CURR_DATE=2022-10-20" && SET "DATA_DIR=tests/__data__/input/__data__" &&'
|
||||
}
|
||||
const ENV_VAR = 'cross-env SITES_DIR=tests/__data__/input/epg_grab/sites CURR_DATE=2022-10-20 DATA_DIR=tests/__data__/input/__data__'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
@@ -103,7 +97,7 @@ describe('epg:grab', () => {
|
||||
})
|
||||
|
||||
it('it will raise an error if the timeout is exceeded', () => {
|
||||
const cmd = `${ENV_VAR} npm run grab --- --channels=tests/__data__/input/epg_grab/custom.channels.xml --output=tests/__data__/output/guide.xml --timeout=0`
|
||||
const cmd = `${ENV_VAR} npm run grab --- --channels=tests/__data__/input/epg_grab/custom.channels.xml --output=tests/__data__/output/guide.xml --timeout=100`
|
||||
const stdout = execSync(cmd, { encoding: 'utf8' })
|
||||
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import { execSync } from 'child_process'
|
||||
import fs from 'fs-extra'
|
||||
import os from 'os'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
|
||||
let ENV_VAR = 'SITES_DIR=tests/__data__/output/sites'
|
||||
if (os.platform() === 'win32') {
|
||||
ENV_VAR = 'SET "SITES_DIR=tests/__data__/output/sites" &&'
|
||||
}
|
||||
const ENV_VAR = 'cross-env SITES_DIR=tests/__data__/output/sites'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
import { execSync } from 'child_process'
|
||||
import fs from 'fs-extra'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
import os from 'os'
|
||||
|
||||
let ENV_VAR = 'SITES_DIR=tests/__data__/input/sites_update/sites ROOT_DIR=tests/__data__/output'
|
||||
if (os.platform() === 'win32') {
|
||||
ENV_VAR =
|
||||
'SET "SITES_DIR=tests/__data__/input/sites_update/sites" && SET "ROOT_DIR=tests/__data__/output" &&'
|
||||
}
|
||||
const ENV_VAR = 'cross-env SITES_DIR=tests/__data__/input/sites_update/sites ROOT_DIR=tests/__data__/output'
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
|
||||
Reference in New Issue
Block a user