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

fix(types): allow `changed` in configuration options (#10651)

authored by

Ari Perkkiö and committed by
GitHub
(Jun 23, 2026, 11:20 PM +0200) 0da12aad 5b864212

+36 -21
+4
docs/.vitepress/config.ts
··· 584 584 link: '/config/disableconsoleintercept', 585 585 }, 586 586 { 587 + text: 'changed', 588 + link: '/config/changed', 589 + }, 590 + { 587 591 text: 'experimental', 588 592 link: '/config/experimental', 589 593 },
+18
docs/config/changed.md
··· 1 + --- 2 + title: changed | Config 3 + outline: deep 4 + --- 5 + 6 + ### changed <CRoot /> 7 + 8 + - **Type:** `boolean | string` 9 + - **Default:** `false` 10 + - **CLI:** `--changed`, `--changed=HEAD~1` 11 + 12 + Run tests only against changed files. If no value is provided, it will run tests against uncommitted changes (including staged and unstaged). 13 + 14 + To run tests against changes made in the last commit, you can use `--changed HEAD~1`. You can also pass commit hash (e.g. `--changed 09a9920`) or branch name (e.g. `--changed origin/develop`). 15 + 16 + When used with code coverage the report will contain only the files that were related to the changes. 17 + 18 + If paired with the [`forceRerunTriggers`](/config/forcereruntriggers) config option it will run the whole test suite if at least one of the files listed in the `forceRerunTriggers` list changes. By default, changes to the Vitest config file and `package.json` will always rerun the whole suite.
+7
docs/guide/cli-generated.md
··· 541 541 542 542 Ignore any unhandled errors that occur 543 543 544 + ### changed 545 + 546 + - **CLI:** `--changed [since]` 547 + - **Config:** [changed](/config/changed) 548 + 549 + Run tests that are affected by the changed files (default: `false`) 550 + 544 551 ### sequence.shuffle.files 545 552 546 553 - **CLI:** `--sequence.shuffle.files`
-13
docs/guide/cli.md
··· 189 189 190 190 <!--@include: ./cli-generated.md--> 191 191 192 - ### changed 193 - 194 - - **Type:** `boolean | string` 195 - - **Default:** false 196 - 197 - Run tests only against changed files. If no value is provided, it will run tests against uncommitted changes (including staged and unstaged). 198 - 199 - To run tests against changes made in the last commit, you can use `--changed HEAD~1`. You can also pass commit hash (e.g. `--changed 09a9920`) or branch name (e.g. `--changed origin/develop`). 200 - 201 - When used with code coverage the report will contain only the files that were related to the changes. 202 - 203 - If paired with the [`forceRerunTriggers`](/config/forcereruntriggers) config option it will run the whole test suite if at least one of the files listed in the `forceRerunTriggers` list changes. By default, changes to the Vitest config file and `package.json` will always rerun the whole suite. 204 - 205 192 ### shard 206 193 207 194 - **Type:** `string`
-1
docs/.vitepress/scripts/cli-generator.ts
··· 11 11 12 12 const skipCli = new Set([ 13 13 'mergeReports', 14 - 'changed', 15 14 'shard', 16 15 ]) 17 16
+7 -7
packages/vitest/src/node/types/config.ts
··· 985 985 * @default true 986 986 */ 987 987 strictTags?: boolean 988 + 989 + /** 990 + * Runs tests that are affected by the changes in the repository, or between specified branch or commit hash 991 + * Requires initialized git repository 992 + * @default false 993 + */ 994 + changed?: boolean | string 988 995 } 989 996 990 997 export interface TypecheckConfig { ··· 1072 1079 * @default 'test' 1073 1080 */ 1074 1081 mode?: string 1075 - 1076 - /** 1077 - * Runs tests that are affected by the changes in the repository, or between specified branch or commit hash 1078 - * Requires initialized git repository 1079 - * @default false 1080 - */ 1081 - changed?: boolean | string 1082 1082 1083 1083 /** 1084 1084 * Test suite shard to execute in a format of <index>/<count>.