You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
includePaths ends up having '../jest-changed-files-test-dir' under Node 23 instead of '.' under Node <=22. This causes git to freak out because the directory is ‘outside the repository.’
/home/sol/src/jest/e2e/__tests__/jestChangedFiles.test.ts
● gets changed files for git
Command failed with exit code 128: git diff --cached --name-only -- nested-dir nested-dir/second-nested-dir ../jest-changed-files-test-dir
fatal: ../jest-changed-files-test-dir: '../jest-changed-files-test-dir' is outside repository at '/tmp/jest-changed-files-test-dir'
207 | ].map(filename => path.resolve(DIR, filename));
208 | console.log(roots);
> 209 | let {changedFiles: files} = await getChangedFilesForRoots(roots, {});
| ^
210 | expect([...files].map(filePath => path.basename(filePath)).sort()).toEqual([
211 | 'file1.txt',
212 | 'file2.txt',
at makeError (node_modules/execa/lib/error.js:60:11)
at async Promise.all (index 0)
at async Promise.all (index 0)
at Object.<anonymous> (e2e/__tests__/jestChangedFiles.test.ts:209:31)
Additional context
This appears to be because of a bug in Node 23, but that's no reason not to try to strip the trailing slash in Jest, defensively. nodejs/node#55448
Version
main branch
Steps to reproduce
Expected behavior
Tests pass.
Actual behavior
includePaths
ends up having'../jest-changed-files-test-dir'
under Node 23 instead of'.'
under Node <=22. This causes git to freak out because the directory is ‘outside the repository.’Additional context
This appears to be because of a bug in Node 23, but that's no reason not to try to strip the trailing slash in Jest, defensively. nodejs/node#55448
Environment
The text was updated successfully, but these errors were encountered: