Jest crashes on systems without find
See original GitHub issue🐛 Bug Report
Jest crashes on systems without find. It would be automatically detected if the utility was available and handled this gracefully.
An alternative would be to allow forceNodeFilesystemAPI
parameter to be passed from
https://github.com/facebook/jest/blob/9ac2dcd55c0204960285498c590c1aa7860e6aa8/packages/jest-core/src/cli/index.ts#L123
to
https://github.com/facebook/jest/blob/89c151b69f81baba49caeceec19f07b4bc2680cc/packages/jest-runtime/src/index.ts#L242
which would force it to not use the find utility.
To Reproduce
Steps to reproduce the behavior:
- Run jest on a system without find (in our case, AWS lambda node12.x runtime)
Docker image for lambda like runtime environment
docker run -it --rm -v <path_to_lambda>:/var/task:ro,delegated --entrypoint /bin/bash lambci/lambda:nodejs12.x
Expected behavior
Jest works without find utility.
Link to repl or repo (highly encouraged)
From node, try to run tests using jest-cli
package
const jestCli = require("jest-cli");
jestCli.runCLI({ }, '.');
Stacktrace Jest crashes with uncaught exception trying to invoke find utility https://github.com/facebook/jest/blob/ee2bea16a9f401581a884d9faa0951b552a86fe4/packages/jest-haste-map/src/crawlers/node.ts#L102
Thrown:
Error: spawn find ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn find',
path: 'find',
spawnargs: [
'/var/task', '-type',
'f', '(',
'-iname', '*.snap',
'-o', '-iname',
'*.js', '-o',
'-iname', '*.json',
'-o', '-iname',
'*.jsx', '-o',
'-iname', '*.node',
')'
],
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:5 (1 by maintainers)
Top GitHub Comments
For sure, go for it! 🙂
Hey @SimenB can I take this issue?