Npm test not working

You must be getting an error as shown in the screenshot below:

npm test is a shortened version of npm run test; npm is running the test command as defined in the package.json configuration file.

Step 1) To fix this we need to check if we are in the right directory to execute the command

Step 2) Check for your current directory using pwd command in terminal and verify it looks similar to:

If not, execute the command: cd /home/crio-user/workspace/<name of cloned repo>/portfolio-frontend.

Step 3) Check your directory structure to see if you have a tests folder with some files in it, npm looks at these test files to execute a particular test as we specify it in the test command.

From task bar on top, do File -> Open Folder -> the cloned Qprofile folder -> portfolio-frontend and press ‘Ok’. Now after the directory structure opens up, check if you have the tests folder that looks like:

Step 4) If you see the folder as above, in the directory we had gone to earlier, execute the npm test <file_name> (<file_name> is based on what the current milestone is asking you to do)

You can read more about npm test here