# 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.

Published: 2026-10-06 | Author: Shashank Bindal | Tags: npm, javascript testing, typescript, edge cases, ci

Canonical page: https://quelltest.com/blog/npm-edge-case-testing

**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?

```bash
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:

```text
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:

```bash
npx quell score src
```

```text
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:

```bash
npx quell score src --coverage lcov.info
```

```text
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](https://quelltest.com/blog/one-verification-layer-for-jest-vitest-mocha-and-node-test.md) has the commands for each.

## What else is in the package now?

| Command | What it does |
| --- | --- |
| `find` | Risk-ranked candidates; `--diff REF` limits to changed lines; `--sarif` for code scanning |
| `score` | Share of candidates your tests execute, from coverage |
| `generate` | Tests for guards it can analyse statically; TODO notes otherwise; `--verify` keeps only tests that fail on a mutant |
| `verify` | Proves a test fails on mutants of the source ([how it works](https://quelltest.com/blog/does-your-test-fail-when-the-code-is-wrong.md)) |
| `gate` | Detects weakened tests in a change ([example](https://quelltest.com/blog/did-the-ai-weaken-your-tests-quell-gate.md)) |
| `mcp` | MCP server for coding agents ([setup](https://quelltest.com/blog/quelltest-mcp-server-and-stop-hook-for-coding-agents.md)) |
| `mocks` | Checks stubs against recorded examples ([details](https://quelltest.com/blog/testing-code-that-calls-apis-and-services-quelltest-0-3-1.md)) |
| `eval` | Prints the bundled benchmark |

## Why does this matter in CI?

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

```bash
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](https://quelltest.com/docs/npm/ci.md).

## 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](https://quelltest.com/docs/npm/limits.md). Quickstart: [/docs/npm/quickstart](https://quelltest.com/docs/npm/quickstart.md). History: [changelog](https://quelltest.com/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

- quelltest for npm: [npmjs.com/package/quelltest](https://www.npmjs.com/package/quelltest)
- Repository and README: [github.com/quelltest/quelltest-npm](https://github.com/quelltest/quelltest-npm)
- Changelog: [CHANGELOG.md](https://github.com/quelltest/quelltest-npm/blob/main/CHANGELOG.md)
- Node.js test runner and its coverage options: [nodejs.org/api/test.html](https://nodejs.org/api/test.html)
- SARIF upload for code scanning: [GitHub documentation](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)
