Skip to content
All posts
·5 min read·Shashank Bindal

Edge-Case Testing for JavaScript and TypeScript Without Replacing Your Test Runner

How quelltest for npm finds untested risky edges in JavaScript and TypeScript, scores them only from coverage evidence, and leaves your runner in charge.

TL;DR. Most Node teams already have a test runner, and quelltest for npm does not replace it. quell find lists untested risky edges with file and line locations, quell score turns them into a number only when you give it coverage evidence, and quell verify and quell gate check that the tests you do have can actually fail. All of it is free and runs offline.

This post was first published on 2026-10-06, when quelltest 0.1 was the current release. We updated it on 2026-10-20 for 0.3.1, which has verify (since 0.2) and added gate, mcp and mocks. Output below is from the published quelltest@0.3.1, Node.js 24.11.0, Windows.

Which edge cases does quelltest look for?

The hard part is knowing which behavior is still untested: a rejected promise, a zero boundary, a nullish branch, a thrown error, or request data that reaches a regular expression.

find parses your source with a real parser and ranks candidates per function: thrown errors, boundaries, nullish paths, JSDoc contracts, schema calls, and a rule pack for defects that lack a guard (regex built from request data, request body written to a document, NoSQL operator injection, path traversal, open redirects, || that swallows 0, unguarded jwt.verify, missing await, hard-coded secrets, eval of input). It follows request data one hop from req.body, req.query and req.params.

How do I run it, and what does it print?

npm install --save-dev quelltest
npx quell find src

On a three-file sample (a plan loader, a health check and a search handler), the first lines are:

Quell scan — 13 edge-case candidates, showing 10
• src/search.js:2 [regex-injection] search — user-controlled text reaches a regular expression; test input such as "(" or ".*" and escape it (medium)
• src/status.js:2 [unguarded-network-call] isHealthy — network call can reject or hang and nothing handles it; test a rejected call, a non-2xx status and a timeout (stub the client); set a timeout or signal (medium)
• src/plan.js:2 [throws] loadPlan — assert the error type and message ("userId required") (high)

Each finding names its rule, its risk level and what kind of test would make it executable. IDs hash the function name and the evidence, not the line number, so they survive unrelated edits.

Why does the score say "not scored"?

Because a score is never invented. Without coverage evidence, quelltest cannot know which candidates your tests execute:

npx quell score src
Score: not scored (no coverage evidence) | 13 candidates

--threshold 60 makes that case exit with code 3 instead of passing silently. Give it an Istanbul coverage-final.json or an lcov.info and it reports the share of candidates your tests execute:

npx quell score src --coverage lcov.info
Score: 31/100 edge-cases-uncovered | 4/13 candidates executed by tests | coverage evidence: lcov

Coverage is matched to candidates by position, and lcov.info is line-granular, so treat the number as a review aid.

Does quelltest replace Vitest, Jest or node:test?

No. Vitest is popular for TypeScript and ESM, Jest is deeply established, and node:test is a minimal built-in option. A gap finder should not force a migration. quelltest identifies candidates and checks tests; your runner stays authoritative. The runner post has the commands for each.

What else is in the package now?

CommandWhat it does
findRisk-ranked candidates; --diff REF limits to changed lines; --sarif for code scanning
scoreShare of candidates your tests execute, from coverage
generateTests for guards it can analyse statically; TODO notes otherwise; --verify keeps only tests that fail on a mutant
verifyProves a test fails on mutants of the source (how it works)
gateDetects weakened tests in a change (example)
mcpMCP server for coding agents (setup)
mocksChecks stubs against recorded examples (details)
evalPrints the bundled benchmark

Why does this matter in CI?

Keep output machine-readable and fail only on an agreed rule:

npx quell find src --diff origin/main --coverage coverage/lcov.info --sarif > quell.sarif
npx quell gate --diff origin/main

Exit codes are distinct: 1 for a score below --threshold, 3 when nothing could be scored, 4 when verify did not verify a test, 5 when gate found weakened tests, 6 when mocks found stub drift. See CI integration.

What are the limits?

  • find output is a set of review hints, not proof of defects. Line-level rules cannot see wrong business rules; the repository's eval/defects.json lists the known misses.
  • Scanning and generation are static. Only verify executes project code, and only your tests or your own --command.
  • generate handles named, exported functions with statically readable guards. Express handlers, React components and most other code become TODO notes.
  • A score is a review aid, not a quality guarantee. Pair it with unit, integration, API, security and end-to-end testing.
  • quelltest is not a browser automation tool, an API contract broker, or a replacement for property testing. Use Playwright, Pact, fast-check or your runner where they fit.
  • One practical catch we found: when lcov.info is written into a coverage/ folder with relative SF: paths (which is what Node's built-in lcov reporter emits), quelltest resolves those paths against the folder holding the lcov file, so no candidate matches. Keeping lcov.info at the project root, or using a reporter that writes absolute paths, avoids it.

More on boundaries: /docs/npm/limits. Quickstart: /docs/npm/quickstart. History: changelog.

FAQ

Does quelltest send my source to a service?

No. It runs locally, and quelltest sends no code to any service. The optional --llm hook runs a module you provide.

Which Node.js versions are supported?

The published 0.3.1 declares Node.js 20 or newer. The next release will require Node.js 22.18+ or 24.11+.

Is it open source?

Yes, Apache-2.0. The separate Python package on PyPI is MIT.

Can I use it with TypeScript?

It parses JavaScript, JSX, TypeScript and TSX. For generated tests, a TypeScript source gets a .test.ts file. We did not test TypeScript projects for this post.

Sources