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
18a package's `"scripts"` object.
19
20### Example
21
22```json
23{
24  "scripts": {
25    "test": "node test.js"
26  }
27}
28```
29
30```bash
31npm test
32> npm@x.x.x test
33> node test.js
34
35(test.js output would be here)
36```
37
38### Configuration
39
40#### `ignore-scripts`
41
42* Default: false
43* Type: Boolean
44
45If true, npm does not run scripts specified in package.json files.
46
47Note that commands explicitly intended to run a particular script, such as
48`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
49will still run their intended script if `ignore-scripts` is set, but they
50will *not* run any pre- or post-scripts.
51
52
53
54#### `script-shell`
55
56* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
57* Type: null or String
58
59The shell to use for scripts run with the `npm exec`, `npm run` and `npm
60init <package-spec>` commands.
61
62
63
64### See Also
65
66* [npm run-script](/commands/npm-run-script)
67* [npm scripts](/using-npm/scripts)
68* [npm start](/commands/npm-start)
69* [npm restart](/commands/npm-restart)
70* [npm stop](/commands/npm-stop)
71