Implement testing framework with Vitest, add unit tests for API routes and utility functions, and configure CI workflow for automated testing. Update package dependencies for testing libraries and add test scripts to package.json.
Some checks are pending
CI / test (push) Waiting to run

This commit is contained in:
2025-12-22 12:50:35 -06:00
parent f92b73c7db
commit c7e7d63be5
16 changed files with 3110 additions and 35 deletions

View File

@@ -1,6 +1,6 @@
import { exec } from 'child_process';
import { promisify } from 'util';
import { readFile, unlink, mkdir, copyFile } from 'fs/promises';
import { unlink, mkdir, copyFile } from 'fs/promises';
import { existsSync } from 'fs';
import path from 'path';
import type { VideoInfo, FormatOption, DownloadRequest, DownloadResponse } from './types';
@@ -22,8 +22,7 @@ function getFfmpegLocationFlag(): string {
const DOWNLOADS_DIR = path.join(process.cwd(), 'downloads');
const PUBLIC_DOWNLOADS_DIR = path.join(process.cwd(), 'public', 'downloads');
// Sanitize filename for safe storage
function sanitizeFilename(filename: string): string {
export function sanitizeFilename(filename: string): string {
return filename
.replace(/[^a-z0-9]/gi, '_')
.replace(/_+/g, '_')