From 23f01b739d7a01a7dc3672322e14eb76ff33d712 Mon Sep 17 00:00:00 2001 From: Michael Garvin Date: Fri, 8 Jan 2021 13:25:20 -0800 Subject: [PATCH] fix(docs): clean up `npm test` docs Adds an example and standardizes the language w/ start and stop PR-URL: https://github.com/npm/cli/pull/2462 Credit: @wraithgar Close: #2462 Reviewed-by: @darcyclarke --- docs/content/commands/npm-test.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/content/commands/npm-test.md b/docs/content/commands/npm-test.md index b8f25d520c82..2cc6a2e38b0f 100644 --- a/docs/content/commands/npm-test.md +++ b/docs/content/commands/npm-test.md @@ -14,7 +14,28 @@ aliases: t, tst ### Description -This runs a package's "test" script, if one was provided. +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