node/deps/npm/docs/content/commands/npm-test.md
Ruy Adorno 1f287b04a2 deps: upgrade npm to 7.4.2
PR-URL: https://github.com/nodejs/node/pull/36953
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-01-18 12:10:57 +01:00

47 lines
614 B
Markdown

---
title: npm-test
section: 1
description: Test a package
---
### Synopsis
```bash
npm test [-- <args>]
aliases: t, tst
```
### Description
This runs a predefined command specified in the `"test"` property of
a package's `"scripts"` object.
### Example
```json
{
"scripts": {
"test": "node test.js"
}
}
```
```bash
npm test
> npm@x.x.x test
> node test.js
(test.js output would be here)
```
### See Also
* [npm run-script](/commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [npm start](/commands/npm-start)
* [npm restart](/commands/npm-restart)
* [npm stop](/commands/npm-stop)