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:
@@ -33,3 +33,9 @@ export function extractYouTubeId(url: string): string | null {
|
||||
export function isValidYouTubeId(id: string): boolean {
|
||||
return /^[A-Za-z0-9_-]{11}$/.test(id);
|
||||
}
|
||||
|
||||
export function formatDuration(seconds: number): string {
|
||||
const mins = Math.floor(seconds / 60);
|
||||
const secs = Math.floor(seconds % 60);
|
||||
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user