Your test suite
Supported frameworks
node:test, a JVM on the JUnit
Platform, Cargo, pytest, and any other runner you wrap by hand. This page lists
what each of them does with that record, when a test file it leaves out could
still have failed, and where each capability is turned on. Each runner named in
the first table has a page of its own that takes every capability in turn.What each runner does
| Your tests run under | Records which tests ran | Leaves out unreached tests | Skips unreached cases | Shards by recorded time | Test stories | Visual review starts from |
|---|---|---|---|---|---|---|
| Vitest 4.1+ | each case; each file in browser mode | itself | yes | yes | yes | jsdom or browser mode |
| Jest 30 | each case | itself | yes | yes | yes | jsdom |
| Rstest | each case; each file in browser mode | itself | no | no | yes | jsdom or @rstest/playwright |
| Playwright | each test | itself | no | yes | yes | the spec |
| Storybook | each story | variance run --since skips them | n/a: a story is a case | variance run --shard | yes | the story |
| A JVM on the JUnit Platform | each test class | variance select prints them | no | no | no | no |
| Cargo | each test | variance select prints them | no | no | no | no |
| pytest | each test | variance select prints them | no | no | no | no |
node:test | each case | itself | no | no | yes | no |
bun test | not recorded: no hook to attach | no | no | no | no | no |
| XCTest and Swift Testing | not recorded: variance reach answers for Swift by target | no | no | no | no | no |
| Any other runner | each case you hand to observer.case | variance select prints them | no | no | yes, in Node | a custom collector |
"Itself" means the runner reads VARIANCE_AUTHORITY_SINCE and never starts the
files it leaves out. "variance select prints them" means the same list comes
out of the CLI, one path per line, for the script that starts your runner to
leave out.
When you can rely on what was left out
Every runner keeps one rule: a test file is left out only when its last whole
run covered none of the code you changed. When the record cannot answer, the run
skips nothing, unless you ask for
--local, which keeps
only the tests that import a changed file. What a skipped test promises states the
rule and every case where it runs more.
What differs between runners is what the recorder can see, and that depends on one thing: whether each test file runs in a process or module graph of its own. When it does, everything the file needs runs again for it and is recorded under it. When several test files share one process, work done once for all of them is recorded under the first file that ran it. A later file that only uses the result has nothing recorded for it, so a change to that work can leave the later file out.
A test file left out this way is not a silent pass forever. When your main
branch runs and records the whole suite, that run includes it, and that run is where it
fails. Until
then, a pull request can be green without it. When main fails that way, the
failing test names the file, and the fix is on the page the table links for
your runner. Many close with before: a list of files in a suite's entry in
variance.config.json, and a change to any of them runs every test.
A function that returns a result it cached in an earlier case can leave out a later case of the same file, under a runner that skips cases, or a later file, where files share one module graph or page: a result a cache returned says what closes it.
| Your tests run under | Each test file runs in | Where a needed test file can be left out, and what closes it |
|---|---|---|
| Vitest | its own module graph, unless isolate is false | a record needs a module graph per test file; under case grain, a later case of the same file: a result a cache returned |
| Rstest | its own module graph, unless isolate is false | a record needs a module graph per test file |
| Jest 30 | its own module registry | a later case of the same file: a result a cache returned |
| Playwright | a new page per test, unless you keep one | a page you keep across tests: a result a cache returned |
| Storybook | one preview for every story | a later story: a result a cache returned |
node:test | its own process | none known: a kept file runs whole |
| A JVM on the JUnit Platform | one JVM for every test class it runs | what a row holds |
| Cargo | its own process, one per test | files every target depends on |
| pytest | one process for the whole suite | when a left-out test could still have failed |
| Any other runner | whatever your harness gives it | work of one case outside the body you hand to observer.case: Sense |
bun test and Swift's runners record nothing, so they leave nothing out: every
test runs. For Swift, variance reach
lists what a diff can reach at target grain, and an import graph is the safe
half says how far to trust it.
Record which tests ran each line
Every other capability reads this record, so it is the first thing a suite sets up. It is one wrap in the configuration your runner already reads:
| Your tests run under | Install | Wrap |
|---|---|---|
| Vitest | @variance-authority/sense | withTestSelection from @variance-authority/sense/vitest, around defineConfig |
| Jest 30 | @variance-authority/sense | withTestSelection from @variance-authority/sense/jest, around the configuration you export |
| Rstest | @variance-authority/sense | withTestSelection from @variance-authority/sense/rstest, inside defineConfig |
| Playwright | @variance-authority/playwright-test | withTestSelection from @variance-authority/playwright-test, inside defineConfig |
| Storybook | @variance-authority/storybook-collector | tests: true in storybookCollector |
| A JVM on the JUnit Platform | the agent and listener jars | the agent on the test JVM |
| Cargo | @variance-authority/cli | none: variance cargo runs cargo test |
| pytest | @variance-authority/cli | none: variance python runs pytest |
node:test | @variance-authority/sense | runNodeTest from @variance-authority/sense/node-test, in place of node --test |
| Any other runner | @variance-authority/sense | observer.case around the body of each case |
What each host records says what the record holds under each of them.
Leave out the tests a change did not reach
Under Vitest, Jest, Rstest, Playwright and node:test, VARIANCE_AUTHORITY_SINCE on the run
you already call leaves out the test files the record proves a change did not
reach. variance run --since leaves out the stories a change did not reach.
Under a JVM, Cargo, pytest and any other runner, variance select prints the same list for
the run to skip. The runner says what it kept before it starts:
selected 12 of 340
Run the tests an edit needs walks through both.
Skip the cases a change did not reach
Under Vitest and Jest, VARIANCE_AUTHORITY_GRAIN=case also skips the cases of a
kept file that entered nothing the change touched. Every other runner runs a
kept file whole. Skip the cases your edit did not
reach says when a file
still runs whole.
Split a run across CI jobs
Vitest, Jest and Playwright place test files on shards by the time each took on
the mainline's last run, and variance run --shard places Storybook stories by
the same rule. Split a test suite across CI jobs sets it up.
Record a test story
VARIANCE_AUTHORITY_STORY=1 records what one test did, in order, under every
runner above but a JVM, Cargo and pytest. Record one lists each
runner's setup.
Add visual review
Visual review captures what a test or a story renders and compares it with the approved image. Each link in the table's last column is the first page for that runner; your first run covers the choice when more than one applies.