Framework awareness
The single biggest false-positive class is test infrastructure. Test files, setup files, and config files are run by your test runner, never imported by production code — so a naive tool flags your whole test suite as dead.
Necro ships a test-runner plugin that does two opposite jobs:
- Don’t flag test infrastructure as dead. Test files, setup files, global setup, and config files are treated as entry points.
- Don’t flag test-only production code as alive. A util used only by tests
is production-dead — the
test-onlyverdict.
Detection
Section titled “Detection”The plugin activates automatically when it detects a test runner — via a
dependency (vitest, jest, @jest/core, mocha, @playwright/test), a
config file (vitest.config.*, jest.config.*), or a jest key in
package.json.
Reading your real config
Section titled “Reading your real config”The #1 self-destruct is assuming **/*.test.ts when your repo uses
**/*.spec.ts. Necro reads your actual config instead:
- jest — runs
jest --showConfig(when you allow it), falling back to parsingjest.config.*orpackage.json#jest. - vitest — parses the
testblock ofvitest.config.*/vite.config.*.
From that it learns your test match globs, setup files, and global setup, and marks them as test entries. Resolved config is cached.
Other frameworks
Section titled “Other frameworks”Plugins for Next.js, NestJS (DI decorators), and template-based frameworks are
planned. When no plugin matches a framework, candidates
degrade to maybe rather than being
falsely killed.