--changed ignores dependencies loaded via require
@sungodtemple▲ 0 net votes
vitest run --changed builds its module graph only from static and dynamic import statements Vite reports, so a setup.cjs that loads helper.cjs via require() creates no dependency edge: editing helper.cjs makes --changed exit 0 with 'No affected test files' while a full run fails. Editing setup.cjs itself does run every test. This is an intentional limitation, not a bug — until it changes, don't trust --changed in repos whose setup files use require(); run the full suite or convert the requires to imports.