Test Gap Analysis: micr-dev/projects
Summary
Analysis of test coverage for the Next.js 16 portfolio showcase application. The codebase has one test file (app/repo-paths.test.mjs) covering utility functions, while the main application logic remains untested.
Existing Tests
| File |
Coverage |
app/repo-paths.test.mjs |
✅ Tests normalizeRepoSlugPath(), getRepoDisplayTitle(), getRepoSlugPath() — 3 test cases |
| All other source files |
❌ No tests |
P2 — repo-sections.ts has no tests (server-side data parsing)
File: app/repo-sections.ts
Severity: P2 (Medium)
getRepoSections() reads REPO.md, parses sections and items, and joins them with repoDescriptions and repoMetadata. If a repo key in REPO.md doesn't have a matching entry in either map, the function throws an Error. This is a critical data integrity check with no test coverage.
Recommendation: Add tests for:
- Happy path: parse valid REPO.md → verify sections structure
- Missing description: verify
throw new Error('Missing repo description...')
- Missing metadata: verify
throw new Error('Missing repo metadata...')
hasRepoSlug(): verify slug lookup in sections
P2 — repo-metadata.ts has no data integrity tests
File: app/repo-metadata.ts
Severity: P2 (Medium)
The repoMetadata record maps 60+ display keys to repo metadata objects. Each entry must have repo, sourceUrl, livePreviewUrl, and isPrivate. No tests verify:
- All keys have valid
sourceUrl patterns
isPrivate is a boolean
repo strings follow org/repo format
- No duplicate entries exist
Recommendation: Add a data integrity test suite:
test("all metadata entries have valid source URLs")
test("all metadata repo fields match org/repo pattern")
test("no duplicate repo values in metadata")
P3 — repo-descriptions.ts / copy batches have no structure validation
Files: app/repo-descriptions.ts, app/repo-copy-batches/*.ts
Severity: P3 (Low)
Per DESCRIPTION.md, each description must have exactly 3 paragraphs and a languages array. The RepoDescription type enforces paragraphs: [string, string, string], but runtime validation is absent. A malformed batch file could ship with 0 or 1 paragraphs without failing type-check if the tuple constraint is bypassed.
Recommendation: Add a test that imports all batches and verifies:
- Each entry has exactly 3 non-empty paragraphs
- Each entry has a non-empty
languages array
- No duplicate keys across batches
P3 — portfolio-shell.tsx Spanish redirect logic untested
File: app/portfolio-shell.tsx
Severity: P3 (Low)
The handlePreloaderComplete callback implements browser language detection and localStorage-based redirect dismissal. This logic has branching for:
hostname === "proyectos.micr.dev" (skip on Spanish subdomain)
localStorage dismissal state
- Browser language detection (
navigator.language)
- Timer-based delay (950ms)
This is client-side logic that's harder to unit test, but the redirect logic could be extracted into a testable utility.
Recommendation: Extract redirect decision logic into a pure function and test it:
export function shouldShowSpanishPrompt(hostname: string, storageValue: string | null, languages: string[]): boolean
P3 — smooth-scroll.tsx Lenis integration untested
File: app/smooth-scroll.tsx
Severity: P3 (Low)
The Lenis smooth scroll client component has proper cleanup (cancelAnimationFrame + lenis.destroy), but the RAF loop and configuration aren't tested. Low priority since it's a thin wrapper around a well-tested library.
Test Infrastructure
- Framework: Node.js built-in
node:test + node:assert/strict (no Jest/Vitest)
- Test runner: Tests use
.mjs extension and import .ts files directly (requires Node 22+ or tsx)
- No CI test step:
package.json scripts have no test script — only dev, build, start, lint
Recommendation: Add "test": "node --test app/repo-paths.test.mjs" to package.json scripts and expand from there.
Priority Order for Adding Tests
- High value:
repo-sections.ts — data parsing with error paths
- High value:
repo-metadata.ts — data integrity across 60+ entries
- Medium value:
repo-descriptions.ts batch structure validation
- Low value: Extract and test Spanish redirect logic
- Low value:
smooth-scroll.tsx Lenis wrapper
Overall Assessment: The codebase has a solid foundation with one well-written test file. The highest-value additions are server-side data integrity tests for the repo metadata and section parsing, which are the core logic of the application.
Test Gap Analysis: micr-dev/projects
Summary
Analysis of test coverage for the Next.js 16 portfolio showcase application. The codebase has one test file (
app/repo-paths.test.mjs) covering utility functions, while the main application logic remains untested.Existing Tests
app/repo-paths.test.mjsnormalizeRepoSlugPath(),getRepoDisplayTitle(),getRepoSlugPath()— 3 test casesP2 —
repo-sections.tshas no tests (server-side data parsing)File:
app/repo-sections.tsSeverity: P2 (Medium)
getRepoSections()readsREPO.md, parses sections and items, and joins them withrepoDescriptionsandrepoMetadata. If a repo key inREPO.mddoesn't have a matching entry in either map, the function throws anError. This is a critical data integrity check with no test coverage.Recommendation: Add tests for:
throw new Error('Missing repo description...')throw new Error('Missing repo metadata...')hasRepoSlug(): verify slug lookup in sectionsP2 —
repo-metadata.tshas no data integrity testsFile:
app/repo-metadata.tsSeverity: P2 (Medium)
The
repoMetadatarecord maps 60+ display keys to repo metadata objects. Each entry must haverepo,sourceUrl,livePreviewUrl, andisPrivate. No tests verify:sourceUrlpatternsisPrivateis a booleanrepostrings followorg/repoformatRecommendation: Add a data integrity test suite:
P3 —
repo-descriptions.ts/ copy batches have no structure validationFiles:
app/repo-descriptions.ts,app/repo-copy-batches/*.tsSeverity: P3 (Low)
Per
DESCRIPTION.md, each description must have exactly 3 paragraphs and alanguagesarray. TheRepoDescriptiontype enforcesparagraphs: [string, string, string], but runtime validation is absent. A malformed batch file could ship with 0 or 1 paragraphs without failing type-check if the tuple constraint is bypassed.Recommendation: Add a test that imports all batches and verifies:
languagesarrayP3 —
portfolio-shell.tsxSpanish redirect logic untestedFile:
app/portfolio-shell.tsxSeverity: P3 (Low)
The
handlePreloaderCompletecallback implements browser language detection and localStorage-based redirect dismissal. This logic has branching for:hostname === "proyectos.micr.dev"(skip on Spanish subdomain)localStoragedismissal statenavigator.language)This is client-side logic that's harder to unit test, but the redirect logic could be extracted into a testable utility.
Recommendation: Extract redirect decision logic into a pure function and test it:
P3 —
smooth-scroll.tsxLenis integration untestedFile:
app/smooth-scroll.tsxSeverity: P3 (Low)
The Lenis smooth scroll client component has proper cleanup (cancelAnimationFrame + lenis.destroy), but the RAF loop and configuration aren't tested. Low priority since it's a thin wrapper around a well-tested library.
Test Infrastructure
node:test+node:assert/strict(no Jest/Vitest).mjsextension and import.tsfiles directly (requires Node 22+ or tsx)package.jsonscripts have notestscript — onlydev,build,start,lintRecommendation: Add
"test": "node --test app/repo-paths.test.mjs"topackage.jsonscripts and expand from there.Priority Order for Adding Tests
repo-sections.ts— data parsing with error pathsrepo-metadata.ts— data integrity across 60+ entriesrepo-descriptions.tsbatch structure validationsmooth-scroll.tsxLenis wrapperOverall Assessment: The codebase has a solid foundation with one well-written test file. The highest-value additions are server-side data integrity tests for the repo metadata and section parsing, which are the core logic of the application.