Problem
When I run jest --watch, I get a permission denied error on a directory in my repository, even if I use watchPathIgnorePatterns for the directory:
Error: EACCES: permission denied, scandir '/path/to/repo/.pgdata'
.pgdata/is a directory used as a Docker volume for postgresql.- The directory is owned by
root.
Solutions tried
I tried using watchPathIgnorePatterns in my jest config:
watchPathIgnorePatterns: ['<rootDir>/\\.pgdata/'],
I tried a similar pattern for modulePathIgnorePatterns and testPathIgnorePatterns.
I also tried setting the owner of .pgdata to my user with chown, but that required a change in the Docker setup that I don't want to make right now.