mmntjs
Compatibility-first migration bridge away from moment.js

Evidence

  • 630/630 moment.js 2.30.1 compatibility tests passing
  • Differential oracle tests and property-based comparisons
  • Coverage-guided fuzzing plus grammar-based ISO generation
  • DST and timezone boundary tests across multiple timezones
  • Regression fixtures for previously discovered edge cases
  • TZ-sensitive test runs in UTC and non-UTC environments

The same quality process covers all entry points (mmntjs/lite, mmntjs/fns, and the default mmntjs entry, with the same oracle tests, regression fixtures, fuzz, and timezone checks.

Philosophy

  • Behavior snapshots matter more than isolated implementation coverage.
  • Known differences should be documented before they surprise users.
  • Timezone, DST, and invalid inputs deserve explicit test strategy, not assumptions.

Current Baseline

Area Value Notes
Upstream compatibility 630/630 moment.js 2.30.1 official test suite
Curated test suite 2,063/2,063 current `bun run test` suite
Timezone coverage 3,846 timezone, DST, and timezone-package cases across six timezones
Coverage baseline 86.03% line coverage after Phase 5 fixes
Mutation 48/48 current curated mutation suite killed
Fuzz harnesses 11 + grammar coverage-guided targets plus grammar-based ISO generation

What Quality Means Here

In a compatibility-oriented library, a passing unit test on a happy path is not enough. Quality means preserving legacy semantics where they are promised, recording discovered edge cases, and resisting the temptation to hand-wave differences as acceptable because they are rare. Rare date/time bugs are often the expensive ones.

The short version: differential testing, regression fixtures, timezone boundary tests, and invalid-input behavior are first-class quality signals. The detailed methodology lives in the repository so reviewers can inspect the actual strategy and historical quality work.

Testing Areas

Differential testing

Use upstream moment.js behavior as the oracle instead of relying on local assumptions.

Edge-case corpus

Preserve previously discovered failures as regression fixtures so migration safety improves over time.

Fuzzing and properties

Explore parsing, formatting, duration, and operation space beyond hand-written examples.

DST and timezone boundaries

Test mode transitions and local-time edge cases where production regressions are expensive.

Release discipline

Treat compatibility changes and known behavior shifts as first-class release notes.

Why This Matters In Migration

  • Legacy systems often rely on undocumented behavior that only differential comparison will reveal.
  • Timezone and DST bugs can pass broad test suites yet still break customer-visible workflows.
  • Regression preservation is what turns one-off bug fixes into growing migration confidence.

Recent Bug Classes Closed

  • keepLocalTime compatibility gaps in UTC/local offset transitions
  • UTC array-input construction and UTC flag propagation
  • invalid-date acceptance caused by missing overflow checks
  • locale parsing over-acceptance in strict month and weekday paths
  • negative zero offset and diff edge-case mismatches

Release Checklist

  • Did this change preserve documented moment.js-compatible behavior?
  • If behavior changed, is the difference explicit in compatibility or changelog docs?
  • Were timezone, invalid-date, and parsing-sensitive paths exercised in at least one realistic test shape?
  • Would a migration reviewer understand the risk of upgrading from the release notes alone?

Detailed Methodology

The command matrix, fuzzing setup, property tests, mutation checks, and coverage notes are maintained in GitHub rather than duplicated here.