1
0
mirror of https://github.com/robonen/lorem-blog.git synced 2026-03-20 10:54:38 +00:00

feat(tests): add comprehensive tests for utility functions and blog context

This commit is contained in:
2025-06-17 16:27:43 +07:00
parent 2cc21ac354
commit e526dc26a1
5 changed files with 329 additions and 3 deletions

View File

@@ -10,6 +10,9 @@
* console.log(time); // Outputs: 1
*/
export function calculateReadingTime(content: string) {
if (!content || content.trim().length === 0)
return 0;
const wordsPerMinute = 200;
const words = content.split(/\s+/).length;