Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
npm-test.md70 linesDownload Raw Back to commands
1---
2title: npm-test
3section: 1
4description: Test a package
5---
6
7### Synopsis
8
9```bash
10npm test [-- <args>]
11
12aliases: tst, t
13```
14
15### Description
16
17This runs a predefined command specified in the `"test"` property of a package's `"scripts"` object.
18
19### Example
20
21```json
22{
23  "scripts": {
24    "test": "node test.js"
25  }
26}
27```
28
29```bash
30npm test
31> npm@x.x.x test
32> node test.js
33
34(test.js output would be here)
35```
36
37### Configuration
38
39#### `ignore-scripts`
40
41* Default: false
42* Type: Boolean
43
44If true, npm does not run scripts specified in package.json files.
45
46Note that commands explicitly intended to run a particular script, such as
47`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run` will still
48run their intended script if `ignore-scripts` is set, but they will *not*
49run any pre- or post-scripts.
50
51
52
53#### `script-shell`
54
55* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
56* Type: null or String
57
58The shell to use for scripts run with the `npm exec`, `npm run` and `npm
59init <package-spec>` commands.
60
61
62
63### See Also
64
65* [npm run](/commands/npm-run)
66* [npm scripts](/using-npm/scripts)
67* [npm start](/commands/npm-start)
68* [npm restart](/commands/npm-restart)
69* [npm stop](/commands/npm-stop)
70 
codekingpro/portable-devtools · Team Ai