Spaces:
Configuration error
Configuration error
Download src/lib/ffmpeg.test.ts from pirzm1/video-generator: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/spaces/pirzm1/video-generator/resolve/main/src/lib/ffmpeg.test.ts
- Command line
-
hf download hf://spaces/pirzm1/video-generator/src/lib/ffmpeg.test.ts
-
curl -L -o ffmpeg.test.ts https://huggingface.co/spaces/pirzm1/video-generator/resolve/main/src/lib/ffmpeg.test.ts
1.15 kB
| /** | |
| * ffmpeg.test.ts — single-runner util contract. | |
| */ | |
| import { test, describe } from 'node:test'; | |
| import assert from 'node:assert/strict'; | |
| import { ffmpegPath, ffmpegCanRun, runFfmpegSync, FfmpegError } from './ffmpeg.js'; | |
| describe('ffmpeg runner', () => { | |
| test('ffmpegPath resolves the bundled binary', () => { | |
| const p = ffmpegPath(); | |
| assert.ok(p && p.length > 0); | |
| assert.ok(p.includes('ffmpeg')); | |
| }); | |
| test('ffmpegCanRun executes the binary (real probe)', () => { | |
| assert.equal(ffmpegCanRun(), true); | |
| }); | |
| test('runFfmpegSync returns version output', () => { | |
| const out = runFfmpegSync(['-version']); | |
| assert.ok(Buffer.isBuffer(out)); | |
| assert.ok(out.toString().includes('ffmpeg')); | |
| }); | |
| test('invalid args reject with FfmpegError (structured, not swallowed)', async () => { | |
| await assert.rejects( | |
| async () => { | |
| const { runFfmpeg } = await import('./ffmpeg.js'); | |
| await runFfmpeg(['-nonsense-flag-that-fails']); | |
| }, | |
| (err: unknown) => err instanceof FfmpegError, | |
| ); | |
| }); | |
| }); | |