From fbea050f00f30f5e9544b0e795d8c57727d99ec0 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Sat, 15 Mar 2025 07:29:59 +0300 Subject: [PATCH] Create test.test.ts --- tests/commands/playlist/test.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/commands/playlist/test.test.ts diff --git a/tests/commands/playlist/test.test.ts b/tests/commands/playlist/test.test.ts new file mode 100644 index 0000000000..feb10640e4 --- /dev/null +++ b/tests/commands/playlist/test.test.ts @@ -0,0 +1,19 @@ +import { execSync } from 'child_process' + +type ExecError = { + status: number + stdout: string +} + +it('shows an error if the playlist contains a broken link', () => { + try { + execSync('ROOT_DIR=tests/__data__/input npm run playlist:test streams_test/ag.m3u', { + encoding: 'utf8' + }) + process.exit(1) + } catch (error) { + expect((error as ExecError).status).toBe(1) + expect((error as ExecError).stdout).toContain('streams_test/ag.m3u') + expect((error as ExecError).stdout).toContain('2 problems (1 errors, 1 warnings)') + } +})