summaryrefslogtreecommitdiff
path: root/deps/npm/test/tap/run-script.js
diff options
context:
space:
mode:
authorKat Marchán <kzm@sykosomatic.org>2015-09-04 14:47:14 -0700
committerRod Vagg <rod@vagg.org>2015-09-06 21:38:09 +1000
commitd15ba80d6f7a473a70081768500260429ecb6218 (patch)
treed83559d4277c56eab5fffb986dd1e4ec8db94a4b /deps/npm/test/tap/run-script.js
parentb4f1711a629251f6aab7615907fe7358881e0648 (diff)
downloadandroid-node-v8-d15ba80d6f7a473a70081768500260429ecb6218.tar.gz
android-node-v8-d15ba80d6f7a473a70081768500260429ecb6218.tar.bz2
android-node-v8-d15ba80d6f7a473a70081768500260429ecb6218.zip
deps: upgrade to npm 2.14.2
PR-URL: https://github.com/nodejs/node/pull/2696 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'deps/npm/test/tap/run-script.js')
-rw-r--r--deps/npm/test/tap/run-script.js29
1 files changed, 28 insertions, 1 deletions
diff --git a/deps/npm/test/tap/run-script.js b/deps/npm/test/tap/run-script.js
index 8dfe574e13..5d414d8e92 100644
--- a/deps/npm/test/tap/run-script.js
+++ b/deps/npm/test/tap/run-script.js
@@ -1,4 +1,4 @@
-var fs = require('fs')
+var fs = require('graceful-fs')
var path = require('path')
var mkdirp = require('mkdirp')
@@ -54,6 +54,14 @@ var both = {
}
}
+var preversionOnly = {
+ name: 'scripted',
+ version: '1.2.3',
+ scripts: {
+ 'preversion': 'echo preversion'
+ }
+}
+
function testOutput (t, command, er, code, stdout, stderr) {
var lines
@@ -192,6 +200,25 @@ test('npm run-script no-params (lifecycle only)', function (t) {
})
})
+test('npm run-script no-params (preversion only)', function (t) {
+ var expected = [
+ 'Lifecycle scripts included in scripted:',
+ ' preversion',
+ ' echo preversion',
+ ''
+ ].join('\n')
+
+ writeMetadata(preversionOnly)
+
+ common.npm(['run-script'], opts, function (err, code, stdout, stderr) {
+ t.ifError(err, 'ran run-script without parameters without crashing')
+ t.notOk(code, 'npm exited without error code')
+ t.notOk(stderr, 'npm printed nothing to stderr')
+ t.equal(stdout, expected, 'got expected output')
+ t.end()
+ })
+})
+
test('npm run-script no-params (direct only)', function (t) {
var expected = [
'Scripts available in scripted via `npm run-script`:',