[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

docs: add releases page (#10432)

authored by

Vladimir and committed by
GitHub
(May 23, 2026, 11:28 AM +0200) 706faacc b3c11615

+237 -1
+57
docs/releases.md
··· 1 + <script setup> 2 + import SupportedVersions from './.vitepress/theme/SupportedVersions.vue'; 3 + </script> 4 + 5 + # Releases 6 + 7 + Vitest releases follow [Semantic Versioning](https://semver.org/). You can see the latest stable version of Vitest in the [Vitest npm package page](https://www.npmjs.com/package/vite). 8 + 9 + A full changelog of past releases is [available on GitHub](https://github.com/vitest-dev/vitest/releases). 10 + 11 + ## Release Cycle 12 + 13 + Vitest does not have a fixed release cycle. 14 + 15 + - **Patch** releases are released as needed (usually every week). 16 + - **Minor** releases always contain new features and are released as needed. Minor releases always have a beta pre-release phase (usually every two months). 17 + - **Major** releases generally align with [Vite](https://vite.dev/releases) and [Node.js EOL schedule](https://endoflife.date/nodejs), and will be announced ahead of time. These releases will have a long beta pre-release phases (usually every year). 18 + 19 + ## Supported Versions 20 + 21 + In summary, the current supported Vitest versions are: 22 + 23 + <SupportedVersions /> 24 + 25 + <br> 26 + 27 + The supported version ranges are automatically determined by: 28 + 29 + - **Current Minor** gets regular fixes. 30 + - **Previous Major** (only for its latest minor) and **Previous Minor** receives important fixes and security patches. 31 + - All versions before these are no longer supported. 32 + 33 + We recommend updating Vitest regularly. Check out the [Migration Guides](/guide/migration) when you update to each Major. We test new Vitest versions before releasing them through the [vitest-ecosystem-ci project](https://github.com/vitest-dev/vitest-ecosystem-ci). Most projects using Vitest should be able to quickly offer support or migrate to new versions as soon as they are released. 34 + 35 + ## Semantic Versioning Edge Cases 36 + 37 + ### TypeScript Definitions 38 + 39 + We may ship incompatible changes to TypeScript definitions between minor versions. This is because: 40 + 41 + - Sometimes TypeScript itself ships incompatible changes between minor versions, and we may have to adjust types to support newer versions of TypeScript. 42 + - Occasionally we may need to adopt features that are only available in a newer version of TypeScript, raising the minimum required version of TypeScript. 43 + - If you are using TypeScript, you can use a semver range that locks the current minor and manually upgrade when a new minor version of Vite is released. 44 + 45 + ## Pre Releases 46 + 47 + Minor releases typically go through a non-fixed number of beta releases. Major releases will go through a long beta phase. 48 + 49 + Pre-releases allow early adopters and maintainers from the Ecosystem to do integration and stability testing, and provide feedback. Do not use pre-releases in production. All pre-releases are considered unstable and may ship breaking changes in between. Always pin to exact versions when using pre-releases. 50 + 51 + ## Deprecations 52 + 53 + We periodically deprecate features that have been superseded by better alternatives in Minor releases. Deprecated features will continue to work with a type or logged warning. They will be removed in the next major release after entering deprecated status. The [Migration Guide](/guide/migration.html) for each major will list these removals and document an upgrade path for them. 54 + 55 + ## Experimental Features 56 + 57 + Some features are marked as experimental when released in a stable version of Vite. Experimental features allow us to gather real-world experience to influence their final design. The goal is to let users provide feedback by testing them in production. Experimental features themselves are considered unstable, and should only be used in a controlled manner. These features may change between Minors, so users must pin their Vite version when they rely on them. We will create [a GitHub discussion](https://github.com/vitest-dev/vitest/discussions/categories/feedback?discussions_q=is%3Aopen+label%3Aexperimental+category%3AFeedback) for each experimental feature.
+7
docs/.vitepress/config.ts
··· 88 88 }), 89 89 llmstxt(), 90 90 ], 91 + define: { 92 + __VITEST_VERSION__: JSON.stringify(version), 93 + }, 91 94 }, 92 95 markdown: { 93 96 config(md) { ··· 227 230 { 228 231 text: 'Team', 229 232 link: '/team', 233 + }, 234 + { 235 + text: 'Releases', 236 + link: '/releases', 230 237 }, 231 238 ], 232 239 },
+1 -1
docs/guide/migration.md
··· 5 5 6 6 # Migration Guide 7 7 8 - [Migrating to Vitest 3.0](https://v3.vitest.dev/guide/migration) | [Migrating to Vitest 2.0](https://v2.vitest.dev/guide/migration) 8 + [Migrating to Vitest 4.0](https://v4.vitest.dev/guide/migration) | [Migrating to Vitest 3.0](https://v3.vitest.dev/guide/migration) 9 9 10 10 ## Migrating to Vitest 5.0 {#vitest-5} 11 11
+172
docs/.vitepress/theme/SupportedVersions.vue
··· 1 + <script setup lang="ts"> 2 + import { computed, ref } from 'vue' 3 + 4 + declare const __VITEST_VERSION__: string 5 + 6 + // Constants 7 + const supportedVersionMessage = { 8 + color: 'var(--vp-c-brand-1)', 9 + text: 'supported', 10 + } 11 + const notSupportedVersionMessage = { 12 + color: 'var(--vp-c-danger-1)', 13 + text: 'not supported', 14 + } 15 + const previousMajorLatestMinors: Record<string, string> = { 16 + 1: '1.6', 17 + 2: '2.1', 18 + 3: '3.2', 19 + 4: '4.1', 20 + } 21 + 22 + // Current latest Vitest version and support info 23 + const parsedViteVersion = parseVersion(__VITEST_VERSION__)! 24 + const supportInfo = computeSupportInfo(parsedViteVersion) 25 + 26 + // Check supported version input 27 + const checkedVersion = ref(`${Math.max(parsedViteVersion.major - 2, 2)}.0.0`) 28 + const checkedResult = computed(() => { 29 + const version = checkedVersion.value 30 + if (!isValidVitestVersion(version)) { 31 + return notSupportedVersionMessage 32 + } 33 + 34 + const parsedVersion = parseVersion(checkedVersion.value) 35 + if (!parsedVersion) { 36 + return notSupportedVersionMessage 37 + } 38 + 39 + const satisfies = (targetVersion: string) => { 40 + const compared = parseVersion(targetVersion)! 41 + return ( 42 + parsedVersion.major === compared.major 43 + && parsedVersion.minor >= compared.minor 44 + ) 45 + } 46 + const satisfiesOneSupportedVersion 47 + = parsedVersion.major >= parsedViteVersion.major // Treat future major versions as supported 48 + || supportInfo.regularPatches.some(satisfies) 49 + || supportInfo.importantFixes.some(satisfies) 50 + || supportInfo.securityPatches.some(satisfies) 51 + 52 + return satisfiesOneSupportedVersion 53 + ? supportedVersionMessage 54 + : notSupportedVersionMessage 55 + }) 56 + 57 + function parseVersion(version: string) { 58 + let [major, minor, patch] = version.split('.').map((v) => { 59 + const num = /^\d+$/.exec(v)?.[0] 60 + return num ? Number.parseInt(num) : null 61 + }) 62 + if (!major) { 63 + return null 64 + } 65 + minor ??= 0 66 + patch ??= 0 67 + 68 + return { major, minor, patch } 69 + } 70 + 71 + function computeSupportInfo( 72 + version: NonNullable<ReturnType<typeof parseVersion>>, 73 + ) { 74 + const { major, minor } = version 75 + const f = (versions: string[]) => { 76 + return versions 77 + .map(v => previousMajorLatestMinors[v] ?? v) 78 + .filter((version) => { 79 + if (!isValidVitestVersion(version)) { 80 + return false 81 + } 82 + // Negative versions are invalid 83 + if (/-\d/.test(version)) { 84 + return false 85 + } 86 + return true 87 + }) 88 + } 89 + 90 + return { 91 + regularPatches: f([`${major}.${minor}`]), 92 + importantFixes: f([`${major - 1}`, `${major}.${minor - 1}`]), 93 + // unlike vite, we only support the last major version 94 + securityPatches: f([`${major - 1}`, `${major}.${minor - 1}`]), 95 + } 96 + } 97 + 98 + function versionsToText(versions: string[]) { 99 + versions = versions.map(v => `<code>vitest@${v}</code>`) 100 + if (versions.length === 0) { 101 + return '' 102 + } 103 + if (versions.length === 1) { 104 + return versions[0] 105 + } 106 + return ( 107 + `${versions.slice(0, -1).join(', ')} and ${versions[versions.length - 1]}` 108 + ) 109 + } 110 + 111 + function isValidVitestVersion(version: string) { 112 + if (version.length === 1) { 113 + version += '.' 114 + } 115 + // Vitest 0.x shouldn't be mentioned 116 + if (version.startsWith('0.')) { 117 + return false 118 + } 119 + return true 120 + } 121 + </script> 122 + 123 + <template> 124 + <div> 125 + <ul> 126 + <li v-if="supportInfo.regularPatches.length"> 127 + Regular patches are released for 128 + <span v-html="versionsToText(supportInfo.regularPatches)" />. 129 + </li> 130 + <li v-if="supportInfo.importantFixes.length"> 131 + Important fixes and security patches are backported to 132 + <span v-html="versionsToText(supportInfo.importantFixes)" />. 133 + </li> 134 + <li> 135 + All versions before these are no longer supported. Users should upgrade 136 + to receive updates. 137 + </li> 138 + </ul> 139 + <p> 140 + If you're using Vitest 141 + <input 142 + v-model="checkedVersion" 143 + class="checked-input" 144 + type="text" 145 + placeholder="0.0.0" 146 + >, it is 147 + <strong :style="{ color: checkedResult.color }">{{ 148 + checkedResult.text 149 + }}</strong>. 150 + </p> 151 + </div> 152 + </template> 153 + 154 + <style scoped> 155 + .checked-input { 156 + display: inline-block; 157 + padding: 0px 5px; 158 + width: 100px; 159 + color: var(--vp-c-text-1); 160 + background: var(--vp-c-bg-soft); 161 + font-size: var(--vp-code-font-size); 162 + font-family: var(--vp-font-family-mono); 163 + border: 1px solid var(--vp-c-divider); 164 + border-radius: 5px; 165 + transition: border-color 0.1s; 166 + } 167 + 168 + .checked-input:focus, 169 + .checked-input:hover { 170 + border-color: var(--vp-c-brand); 171 + } 172 + </style>