Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed as not planned
Closed as not planned
Copy link
Description
Version
main branch
Steps to reproduce
yarn jest-jasmine-ci e2e/__tests__/jestChangedFiles.test.ts 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.’
/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
Environment
System: OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish) CPU: (64) x64 AMD EPYC 7502P 32-Core Processor Binaries: Node: 23.0.0 - ~/n/bin/node Yarn: 3.8.5 - ~/.local/share/pnpm/yarn npm: 10.9.0 - ~/n/bin/npm npmPackages: jest: workspace:* => 30.0.0-alpha.6