Skip to content

Add focused MP3/MP4 metadata regression tests with Vitest#45

Merged
ChrisAdamsdevelopment merged 2 commits into
mainfrom
codex/add-regression-tests-for-mp3/mp4-metadata
May 24, 2026
Merged

Add focused MP3/MP4 metadata regression tests with Vitest#45
ChrisAdamsdevelopment merged 2 commits into
mainfrom
codex/add-regression-tests-for-mp3/mp4-metadata

Conversation

@ChrisAdamsdevelopment
Copy link
Copy Markdown
Owner

Motivation

  • Lock in recent metadata behavior (MP3 quick-cleanse frame strategy, MP4 ItemList/Keys writes and XMP/timestamp hygiene, and blank-by-default release defaults) with automated regression tests so future changes cannot regress these flows.
  • Avoid requiring external binaries or runtime side effects (ExifTool, browser binary writers, Stripe/Gemini) in tests by targeting pure helpers and mocking heavy dependencies.

Description

  • Added Vitest + jsdom and lightweight config plus test and test:run npm scripts to run deterministic offline unit tests.
  • Added MP3 tests (tests/metadata-mp3.test.ts) that mock browser-id3-writer and assert writeMP3Metadata frame planning/reporting behavior (no TENC/TSSE, frameReport shape, albumArtist fallback, comment/producer/tags folding, optional lyrics handling, and safe skipping of unsupported frames).
  • Added MP4/server helper tests (tests/processor-helpers.test.ts) that exercise buildMetaToWrite, buildQualityVerification, and classifyMetadataPersistenceStage to assert ItemList/Keys tag emission, absence of unqualified XMP-producing tags and Creator fallback, XMP/ExifTool residue failures, zero QuickTime timestamp detection, and final verification classification semantics.
  • Extracted pure release-defaults helpers into src/utils/releaseDefaults.ts and added tests/release-defaults.test.ts to validate localStorage-backed defaults (blank-by-default, lyrics excluded from stored defaults, and filename-derived title preservation) without changing runtime behavior.
  • Updated CI frontend jobs to run npm run test:run while keeping existing Node/.nvmrc and build/test flow intact.

Testing

  • Ran npm run test:run (Vitest) locally: all added tests passed (7 tests across MP3, MP4 helper, and release-defaults suites).
  • Ran npm run build (TypeScript + Vite) and node --check server/processor.js to validate no runtime syntax errors; both succeeded.
  • Verified grep checks for TENC/TSSE and expected metaToWrite tag usage in codebase; no unintended runtime changes were introduced.

Files changed: package.json, package-lock.json, vitest.config.ts, tests/metadata-mp3.test.ts, tests/processor-helpers.test.ts, tests/release-defaults.test.ts, src/utils/releaseDefaults.ts, and CI workflow updates in .github/workflows/ci.yml and .github/workflows/ci-cd.yml.


Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spectracleanseai Ready Ready Preview, Comment, Open in v0 May 24, 2026 11:06pm

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @ChrisAdamsdevelopment, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@ChrisAdamsdevelopment ChrisAdamsdevelopment merged commit d9c6036 into main May 24, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant