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
Some checks are pending
CI / test (push) Waiting to run
This commit is contained in:
@@ -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, '_')
|
||||
|
||||
Reference in New Issue
Block a user