npm-test.1 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .TH "NPM-TEST" "1" "March 2026" "NPM@11.12.0" ""
  2. .SH "NAME"
  3. \fBnpm-test\fR - Test a package
  4. .SS "Synopsis"
  5. .P
  6. .RS 2
  7. .nf
  8. npm test \[lB]-- <args>\[rB]
  9. aliases: tst, t
  10. .fi
  11. .RE
  12. .SS "Description"
  13. .P
  14. This runs a predefined command specified in the \fB"test"\fR property of a package's \fB"scripts"\fR object.
  15. .SS "Example"
  16. .P
  17. .RS 2
  18. .nf
  19. {
  20. "scripts": {
  21. "test": "node test.js"
  22. }
  23. }
  24. .fi
  25. .RE
  26. .P
  27. .RS 2
  28. .nf
  29. npm test
  30. > npm@x.x.x test
  31. > node test.js
  32. (test.js output would be here)
  33. .fi
  34. .RE
  35. .SS "Configuration"
  36. .SS "\fBignore-scripts\fR"
  37. .RS 0
  38. .IP \(bu 4
  39. Default: false
  40. .IP \(bu 4
  41. Type: Boolean
  42. .RE 0
  43. .P
  44. If true, npm does not run scripts specified in package.json files.
  45. .P
  46. Note that commands explicitly intended to run a particular script, such as \fBnpm start\fR, \fBnpm stop\fR, \fBnpm restart\fR, \fBnpm test\fR, and \fBnpm run\fR will still run their intended script if \fBignore-scripts\fR is set, but they will \fInot\fR run any pre- or post-scripts.
  47. .SS "\fBscript-shell\fR"
  48. .RS 0
  49. .IP \(bu 4
  50. Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
  51. .IP \(bu 4
  52. Type: null or String
  53. .RE 0
  54. .P
  55. The shell to use for scripts run with the \fBnpm exec\fR, \fBnpm run\fR and \fBnpm
  56. init <package-spec>\fR commands.
  57. .SS "See Also"
  58. .RS 0
  59. .IP \(bu 4
  60. npm help run
  61. .IP \(bu 4
  62. npm help scripts
  63. .IP \(bu 4
  64. npm help start
  65. .IP \(bu 4
  66. npm help restart
  67. .IP \(bu 4
  68. npm help stop
  69. .RE 0