test(mutation): triage the surviving mutants in the non-core files

Open
#300 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
bun, github-actions, javascript, typescript

Research direction

Start with the named test files, such as test/ecb-edges.test.ts and test/boe-edges.test.ts, and the nightly mutant counts in the issue; rerun mutation testing for files whose source changed since the listed nightly. For each surviving mutant, add a test that catches a real bug of that shape or document it in docs/explanation/equivalent-mutants.md, using the Stryker comment only where it applies to every mutant on that line. The work is done when the non-core mutants are triaged and the listed equivalents or tests account for them.

Written by the indexing model from the issue text.

Description

area: tests

Follow-up to #56. That issue's triage covered the core files (money, rounding, allocate, decimal, parse, fixed, exact, currency, convert, rate) and ecb, boe, fetch and testing/index (#286, #289–#299). This issue covers the rest the same way: kill each surviving mutant with a test that would catch a real bug of that shape, or add it to docs/explanation/equivalent-mutants.md (or a // Stryker disable next-line comment where every mutant of that kind on the line is equivalent). Counts are survived + no coverage from the 2026-11-11 nightly, unless noted.

1. Source changed since 2026-11-11: triage from a current nightly

file estimate
finance.ts / finance-shared.ts / excel.ts (rewritten) 2–3 h
wire.ts (59) 1 h
format.ts (40) 1 h
math.ts (20), sql.ts (18), tiers.ts (8), tax.ts, prisma.ts (6) 1–1.5 h together
plugins/core, exact, format, math; testing/jest 30 min together

2. Parsers and validators: mostly killable with malformed-input and boundary tests (see test/ecb-edges.test.ts and test/boe-edges.test.ts for the pattern)

file survived + no coverage estimate
adyen-fx.ts 47 1 h
history.ts 36 1 h
rate-text.ts 30 45 min
provider.ts 20 45 min
hmrc.ts 28 45 min
boc.ts 25 45 min
fed.ts 22 45 min
processor.ts 32 1 h
cash.ts 29 45 min
pricing.ts 33 1 h
words.ts 17 30 min
schema.ts 14 30 min
currencies.ts 12 20 min
scale.ts 21 30 min (mostly the same fast-path equivalents as money.ts)
the small processor and plugin files (stripe, adyen, paypal, klarna, braintree, checkout, crypto, bag, policy, territories, zod, valibot, fixed-money) about 60 1.5 h

3. Mostly equivalent, or awkward to kill

  • rbnf.ts (91): the RBNF interpreter supports rule features the shipped CLDR rules never use (>>> substitutions, $(ordinal,…) plurals), so their mutants have no coverage. Kill them with small hand-written rule sets, or list them as unused by the shipped data. About 2 h.
  • testing/arbitraries.ts (52): bounds inside fast-check generators. The tests check that generated values satisfy invariants, not their distribution, so most of these are equivalent; kill the ones that would generate invalid values. About 1 h.

Database adapters: the mutation run now includes test/db's SQLite part (no servers). Postgres/MySQL-only code is listed in equivalent-mutants.md as covered by the CI database job, not mutation-tested.

Tips from the core triage:

  • --ignoreStatic in a local run makes static mutants that also have per-test coverage run with runtime activation, so their local results mean nothing. Judge static mutants from the nightly.
  • A // Stryker disable next-line placed inside an if (…) condition, right before ) {, does not reach the block, so list those mutants instead.
  • Bun runs every test file in one process; restore anything you install on Money.prototype, and don't use vi.stubGlobal.
Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
35m
Merged PRs (30d)
242

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from public/ducat

All issues in public/ducat

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.