ENAMETOOLONG: name too long, open...
See original GitHub issue- Issue
We have an angular 2 project which includes a component lib in the node_modules folder, which must be complied by jest since it is shipped with .ts files. This results in very long file names like this one:
/Users/wayne/web/myProject-newAmazingApp-ui/node_modules/myProject-components-ui/src/lib/components/container/my-dialog-edit-select-box/my-edit-select-box-item/my-edit-select-box-item.component.html
When running jest I receive the following error:
ENAMETOOLONG: name too long, open '/var/folders/lr/dg7jdw9n2f7d8j1pns2drsfr0000gn/T/jest/ts-jest/L1VzZXJzL3BpdHRpL3dlYi91bHBpYW4tZmFsbGJlYXJiZWl0dW5nLXVpL25vZGVfbW9kdWxlcy91bHBpYW4tY29tcG9uZW50cy11aS9zcmMvbGliL2NvbXBvbmVudHMvY29udGFpbmVyL3VsLWRpYWxvZy1lZGl0LXNlbGVjdC1ib3gvdWwtZWRpdC1zZWxlY3QtYm94LWl0ZW0vdWwtZWRpdC1zZWxlY3QtYm94LWl0ZW0uY29tcG9uZW50LnRz'
at Object.fs.openSync (fs.js:584:18)
at Object.fs.writeFileSync (fs.js:1316:33)
at process (node_modules/ts-jest/dist/preprocessor.js:25:16)
at Object.module.exports.process (node_modules/jest-preset-angular/preprocessor.js:12:10)
- Expected behavior
It should work.
I have already created a pull request (https://github.com/kulshekhar/ts-jest/pull/152) which uses a hash instead of a Buffer to create the files names for the cache. The problem is that the code coverage processor must encrypt the cached files names to generate the report. This is not possible with a hash. And I have not found a solution so far to encrypt the filename with a fixed length.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:14 (12 by maintainers)
Top GitHub Comments
try to add “data:image/png;base64,” before name of file exemple: data:image/png;base64,L1VzZXJzL3BpdHRpL3dlYi91bHBpYW4tZmFsbGJlYXJiZWl0dW5nLXVpL25vZGVfbW9kdWxlcy91bHBpYW4tY29tcG9uZW50cy11aS9zcmMvbGliL2NvbXBvbmVudHMvY29udGFpbmVyL3VsLWRpYWxvZy1lZGl0LXNlbGVjdC1ib3gvdWwtZWRpdC1zZWxlY3QtYm94LWl0ZW0vdWwtZWRpdC1zZWxlY3QtYm94LWl0ZW0uY29tcG9uZW50LnRz
@kryops once the feedback on that PR is incorporated, I’ll merge it