Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitry Litvinchenko <karaliti@gmail.com>2017-01-25 17:10:49 +0300
committerKat Marchán <kzm@sykosomatic.org>2017-01-25 17:10:49 +0300
commitd75fc03eda5364f12ac266fa4f66e31c2e44e864 (patch)
tree76bd1299a5e24be57c9d69fe6b7ecdc6518eff43 /test
parentae8e71c2b7d64d782af287a21e146d7cea6e5273 (diff)
run-script: keep exit code (#15413)
PR-URL: https://github.com/npm/npm/pull/15413 Credit: @kapals Reviewed-By: @iarna
Diffstat (limited to 'test')
-rw-r--r--test/tap/run-script.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/tap/run-script.js b/test/tap/run-script.js
index 3892337ce..4dea9b836 100644
--- a/test/tap/run-script.js
+++ b/test/tap/run-script.js
@@ -67,6 +67,14 @@ var preversionOnly = {
}
}
+var exitCode = {
+ name: 'scripted',
+ version: '1.2.3',
+ scripts: {
+ 'start': 'node -e "process.exit(7)"'
+ }
+}
+
function testOutput (t, command, er, code, stdout, stderr) {
var lines
@@ -323,6 +331,17 @@ test('npm run-script no-params (direct only)', function (t) {
})
})
+test('npm run-script keep non-zero exit code', function (t) {
+ writeMetadata(exitCode)
+
+ common.npm(['run-script', 'start'], opts, function (err, code, stdout, stderr) {
+ t.ifError(err, 'ran run-script without parameters without crashing')
+ t.equal(code, 7, 'got expected exit code')
+ t.ok(stderr, 'should generate errors')
+ t.end()
+ })
+})
+
test('cleanup', function (t) {
cleanup()
t.end()