I'm trying to create a Makefile that runs the test suite for my react app. From the root folder the react app is located at frontend/
.
What make command can I create the achieve this? I've tried the following but no luck:
test-frontend:
cd ./frontend/
npm test
test-frontend:
npm test ./frontend/
test-frontend:
cd ./frontend/
npm run-script test
Here's the error I get:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /path/to/dir/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/path/to/dir/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /$HOME/.npm/_logs/2019-10-24T02_23_23_195Z-debug.log
make: *** [test-frontend] Error 254