This error means your current project’s package.json doesn’t have a "test" script, even though the command is trying to run npm test.
Check that you’re in the right folder and that your package.json has a "test" script (e.g. using Jest).