Files
iptv/tests/commands/report/create.test.ts

33 lines
4.2 KiB
TypeScript
Raw Normal View History

2023-09-15 18:40:14 +03:00
import { execSync } from 'child_process'
2025-04-22 03:47:28 +03:00
import os from 'os'
2023-09-15 18:40:14 +03:00
2025-04-22 03:47:28 +03:00
let ENV_VAR = 'DATA_DIR=tests/__data__/input/data STREAMS_DIR=tests/__data__/input/report_create'
if (os.platform() === 'win32') {
ENV_VAR =
'SET "DATA_DIR=tests/__data__/input/data" && SET "STREAMS_DIR=tests/__data__/input/report_create" &&'
}
2023-09-15 18:40:14 +03:00
2025-04-22 03:47:28 +03:00
describe('report:create', () => {
it('can create report', () => {
const cmd = `${ENV_VAR} npm run report:create`
const stdout = execSync(cmd, { encoding: 'utf8' })
if (process.env.DEBUG === 'true') console.log(cmd, stdout)
expect(
stdout.includes(`
2025-03-29 11:39:30 +03:00
(index) issueNumber type streamId streamUrl status
0 14120 'streams:edit' 'boo.us' 'https://livestream.telvue.com/templeuni1/f7b44cfafd5c52223d5498196c8a2e7b.sdp/playlist.m3u8' 'invalid_id'
1 14135 'streams:add' 'BBCWorldNews.uk@SouthAsia' 'http://103.199.161.254/Content/bbcworld/Live/Channel%28BBCworld%29/Stream%2801%29/index.m3u8' 'wrong_id'
2 14177 'streams:add' 'TUTV.us' 'https://livestream.telvue.com/templeuni1/f7b44cfafd5c52223d5498196c8a2e7b.sdp/playlist.m3u8' 'on_playlist'
3 14178 'streams:add' 'TV3.my' 'https://live-streams-ssai-01.tonton.com.my/live/2dd2b7cd-1b34-4871-b669-57b5c9beca23/live.isml/.m3u8...' 'blocked'
2025-05-01 00:50:53 +03:00
4 16120 'streams:remove' undefined 'http://190.61.102.67:2000/play/a038/index.m3u8' 'wrong_link'
2025-03-29 11:39:30 +03:00
5 19956 'channel search' 'CNBCe.tr' undefined 'invalid_id'
2025-07-10 21:12:54 +03:00
6 19957 'channel search' '13thStreet.au' undefined 'closed'
7 20956 'channel search' 'IONTV.us' undefined 'fulfilled'
2025-03-29 11:39:30 +03:00
`)
2025-04-22 03:47:28 +03:00
).toBe(true)
})
2023-09-15 18:40:14 +03:00
})