Linux command
npm-test 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run tests
npm test
Run tests with arguments
npm test -- --coverage
Run tests silently
npm test --silent
Shorthand
npm t
说明
npm test runs the "test" script defined in package.json. It's an alias for "npm run test" and is the conventional command for running a project's test suite. Exit code 0 indicates success; non-zero indicates test failure.
参数
- --
- Pass arguments to test script.
- --silent
- Reduce output.
- --ignore-scripts
- Don't run scripts.
FAQ
What is the npm-test command used for?
npm test runs the "test" script defined in package.json. It's an alias for "npm run test" and is the conventional command for running a project's test suite. Exit code 0 indicates success; non-zero indicates test failure.
How do I run a basic npm-test example?
Run `npm test` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -- do in npm-test?
Pass arguments to test script.