summaryrefslogtreecommitdiff
path: root/deps/npm/test/tap/gently-rm-symlinked-global-dir.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/test/tap/gently-rm-symlinked-global-dir.js')
-rw-r--r--deps/npm/test/tap/gently-rm-symlinked-global-dir.js26
1 files changed, 10 insertions, 16 deletions
diff --git a/deps/npm/test/tap/gently-rm-symlinked-global-dir.js b/deps/npm/test/tap/gently-rm-symlinked-global-dir.js
index b159a4ec2f..8ac290091c 100644
--- a/deps/npm/test/tap/gently-rm-symlinked-global-dir.js
+++ b/deps/npm/test/tap/gently-rm-symlinked-global-dir.js
@@ -37,7 +37,7 @@ test('install and link', function (t) {
'--global',
'--prefix', lnk,
'--loglevel', 'silent',
- '--unicode', 'false',
+ '--json',
'install', '../test-linked'
],
EXEC_OPTS,
@@ -54,7 +54,7 @@ test('install and link', function (t) {
'--global',
'--prefix', lnk,
'--loglevel', 'silent',
- '--unicode', 'false',
+ '--json',
'install', '../test-linked'
],
EXEC_OPTS,
@@ -83,27 +83,21 @@ test('cleanup', function (t) {
t.end()
})
-function removeBlank (line) {
- return line !== ''
-}
-
function resolvePath () {
return resolve.apply(null, Array.prototype.slice.call(arguments)
.filter(function (arg) { return arg }))
}
function verify (t, stdout) {
- var binPath = resolvePath(lnk, !isWindows && 'bin', 'linked')
+ var result = JSON.parse(stdout)
var pkgPath = resolvePath(lnk, !isWindows && 'lib', 'node_modules', '@test', 'linked')
- var trgPath = resolvePath(pkgPath, 'index.js')
- t.deepEqual(
- stdout.split('\n').filter(removeBlank),
- [ binPath + ' -> ' + trgPath,
- resolvePath(lnk, !isWindows && 'lib'),
- '`-- @test/linked@1.0.0 '
- ],
- 'got expected install output'
- )
+ if (result.added.length) {
+ t.is(result.added.length, 1, 'added the module')
+ t.is(result.added[0].path, pkgPath, 'in the right location')
+ } else {
+ t.is(result.updated.length, 1, 'updated the module')
+ t.is(result.updated[0].path, pkgPath, 'in the right location')
+ }
}
function cleanup () {