1 var cat = require('graceful-fs').writeFileSync
2 var resolve = require('path').resolve
4 var mkdirp = require('mkdirp')
5 var mr = require('npm-registry-mock')
6 var rimraf = require('rimraf')
7 var test = require('tap').test
8 var tmpdir = require('osenv').tmpdir
10 var common = require('../common-tap.js')
12 var pkg = resolve(__dirname, 'ls-l-depth-0')
13 var dep = resolve(pkg, 'deps', 'glock')
14 var modules = resolve(pkg, 'node_modules')
21 ' an inexplicably hostile sample package\n' +
22 ' git+https://github.com/npm/glo.ck.git\n' +
28 var EXEC_OPTS = { cwd: pkg }
34 'description': 'an inexplicably hostile sample package',
35 'homepage': 'https://glo.ck',
36 'repository': 'https://github.com/npm/glo.ck',
42 test('setup', function (t) {
44 mr({ port: common.port }, function (er, s) {
51 test('#6311: npm ll --depth=0 duplicates listing', function (t) {
54 '--loglevel', 'silent',
55 '--registry', common.registry,
59 function (err, code, stdout, stderr) {
60 t.ifError(err, 'npm install ran without error')
61 t.notOk(code, 'npm install exited cleanly')
62 t.notOk(stderr, 'npm install ran silently')
65 'glock@1.8.7 node_modules/glock\n└── underscore@1.5.1',
66 'got expected install output'
71 '--loglevel', 'silent',
76 function (err, code, stdout, stderr) {
77 t.ifError(err, 'npm ll ran without error')
78 t.notOk(code, 'npm ll exited cleanly')
79 t.notOk(stderr, 'npm ll ran silently')
83 'got expected package name'
93 test('cleanup', function (t) {
100 function cleanup () {
101 process.chdir(tmpdir())
111 cat(resolve(dep, 'package.json'), JSON.stringify(fixture))