Vitest 5.1.0-beta.1 Adds --last-failed and --since-last-run Flags and Temporal Support in Fake Timers
Vitest 5.1.0-beta.1, a prerelease published October 19, adds CLI flags to rerun failed tests or tests affected since the last run, plus Temporal support in vi.setSystemTime().
Overview
The Vitest test framework published version 5.1.0-beta.1 on October 19, 2026, marked as a prerelease on GitHub. The release notes list two new command-line flags for narrowing which tests run, support for the Temporal API in fake timers, and several additions to browser mode.
What We Know
New test-selection flags
The release notes list the first new flag as “Add --last-failed to run only failed tests.” According to the pull request that introduced it, the flag is CLI-only. The pull request says a results.json file stores the full names of failed tests per file, and that “A failure outside of tests (hook, collection) reruns the whole file.” It also states that names are used instead of ids, “so adding or moving tests in the file keeps the selection,” that the flag works with vitest list and other filters, and that in watch mode only the first run is narrowed.
The second flag, listed in the release notes as “Introduce --since-last-run flag,” runs tests whose dependencies changed since the previous run. The pull request says that unlike --changed, it “doesn’t require git and reuses a cached dependency tree instead of parsing every file on each invocation.” The same pull request says it exposes a resolver object to custom version-control providers and adds a new mtime provider that the flag uses under the hood.
Fake timers and retries
The release notes add support for Temporal.Instant and Temporal.ZonedDateTime in vi.setSystemTime(). They also list support for fake timers for node:timers and node:timers/promise, and an entry reading “Expose per-retry/repeat attempt result.”
Browser mode
Under the browser heading, the release notes list the following:
- “Mock modules through an import map”
- “Drop experimental label from trace view”
- “Introduce experimental
pointerAPI” - “Capture aria snapshot in trace view”
The same notes list a browser fix, “Change default port to 23315.” The pull request for that change says the previous default, 63315, “can be reserved by Windows when Hyper-V, WSL2, or Docker Desktop is running.” It adds that binding a reserved port fails with EACCES, while Vite only falls back to the next port on EADDRINUSE, “so the run fails.” The pull request describes 23315-23318 as unassigned in the IANA registry.
Other fixes
The release notes also list “Rerun setup files after --changed filtering,” “Return the mock to concurrent imports,” and a performance entry, “Reuse fsModuleCache in static collection.”
What We Don’t Know
The release is a beta, and the sources reviewed give no date for a stable 5.1.0. The release notes are a changelog and do not describe how the new flags behave in every configuration; the details above come from the individual pull request descriptions. The sources do not report performance measurements for --since-last-run compared with --changed, and they do not say whether any of the flagged options will change before a stable release.