There are time when the docker volume can be a problem.
Especially when running watch
e.g. jest --watch
throws:
Then we see the problem
chgrp
or chown
, Docker cannot read this file anymoresudo
, the command try to revert the change.One way is to mount the volume somewhere outside the repos.
Easier way is to make jest ignore this path by editing jest.config.json
file.
This file is loaded by default. No need to specified in jest
command.
// jest.config.json
{
"testRegex": "((\\.|/*.)(spec))\\.js?$",
"clearMocks": true,
"testEnvironment": "node",
"testPathIgnorePatterns": [
"/node_modules/",
"postgres-data",
"db.sql"
],
"watchPathIgnorePatterns": [
"/node_modules/",
"postgres-data",
"db.sql"
]
}
Leave me some comment if this save your time.
Cheers!