diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-04-08 20:01:49 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-04-09 07:40:17 +0300 |
commit | 28ce62e3c2f887162c7fd36bd417b46033148980 (patch) | |
tree | fbed7d9e55bc96fe504b6f2fda32bc294bb783fe | |
parent | f40ecaad68f77abc50eb6f5b224e31dec3d250fc (diff) |
test: standardize test/tap/ls-l-depth-0.js
-rw-r--r-- | test/tap/ls-l-depth-0.js | 98 |
1 files changed, 48 insertions, 50 deletions
diff --git a/test/tap/ls-l-depth-0.js b/test/tap/ls-l-depth-0.js index 8833c1721..09298bdd7 100644 --- a/test/tap/ls-l-depth-0.js +++ b/test/tap/ls-l-depth-0.js @@ -1,76 +1,74 @@ -var cat = require("graceful-fs").writeFileSync -var resolve = require("path").resolve +var cat = require('graceful-fs').writeFileSync +var resolve = require('path').resolve -var mkdirp = require("mkdirp") -var mr = require("npm-registry-mock") -var rimraf = require("rimraf") -var test = require("tap").test -var tmpdir = require("osenv").tmpdir +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test +var tmpdir = require('osenv').tmpdir -var common = require("../common-tap.js") +var common = require('../common-tap.js') -var pkg = resolve(__dirname, "ls-l-depth-0") -var dep = resolve(pkg, "deps", "glock") -var modules = resolve(pkg, "node_modules") +var pkg = resolve(__dirname, 'ls-l-depth-0') +var dep = resolve(pkg, 'deps', 'glock') +var modules = resolve(pkg, 'node_modules') var expected = - "\n" + - "│ " + pkg + "\n" + - "│ \n" + - "└── glock@1.8.7\n" + - " an inexplicably hostile sample package\n" + - " https://github.com/npm/glo.ck\n" + - " https://glo.ck\n" + - "\n" + '\n' + + '│ ' + pkg + '\n' + + '│ \n' + + '└── glock@1.8.7\n' + + ' an inexplicably hostile sample package\n' + + ' https://github.com/npm/glo.ck\n' + + ' https://glo.ck\n' + + '\n' var server -var EXEC_OPTS = { - cwd : pkg -} +var EXEC_OPTS = { cwd: pkg } -test("setup", function (t) { +test('setup', function (t) { setup() - mr({port : common.port}, function (er, s) { + mr({ port: common.port }, function (er, s) { server = s t.end() }) }) -test("#6311: npm ll --depth=0 duplicates listing", function (t) { +test('#6311: npm ll --depth=0 duplicates listing', function (t) { common.npm( [ - "--loglevel", "silent", - "--registry", common.registry, - "install", dep + '--loglevel', 'silent', + '--registry', common.registry, + 'install', dep ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, "npm install ran without error") - t.notOk(code, "npm install exited cleanly") - t.notOk(stderr, "npm install ran silently") + t.ifError(err, 'npm install ran without error') + t.notOk(code, 'npm install exited cleanly') + t.notOk(stderr, 'npm install ran silently') t.equal( stdout.trim(), - "glock@1.8.7 node_modules/glock\n└── underscore@1.5.1", - "got expected install output" + 'glock@1.8.7 node_modules/glock\n└── underscore@1.5.1', + 'got expected install output' ) common.npm( [ - "--loglevel", "silent", - "ls", "--long", - "--depth", "0" + '--loglevel', 'silent', + 'ls', '--long', + '--depth', '0' ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, "npm ll ran without error") - t.notOk(code, "npm ll exited cleanly") - t.notOk(stderr, "npm ll ran silently") + t.ifError(err, 'npm ll ran without error') + t.notOk(code, 'npm ll exited cleanly') + t.notOk(stderr, 'npm ll ran silently') t.equal( stdout, expected, - "got expected package name" + 'got expected package name' ) t.end() @@ -80,7 +78,7 @@ test("#6311: npm ll --depth=0 duplicates listing", function (t) { ) }) -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() server.close() @@ -88,14 +86,14 @@ test("cleanup", function (t) { }) var fixture = { - "name" : "glock", - "version" : "1.8.7", - "private" : true, - "description" : "an inexplicably hostile sample package", - "homepage" : "https://glo.ck", - "repository" : "https://github.com/npm/glo.ck", - "dependencies" : { - "underscore" : "1.5.1" + 'name': 'glock', + 'version': '1.8.7', + 'private': true, + 'description': 'an inexplicably hostile sample package', + 'homepage': 'https://glo.ck', + 'repository': 'https://github.com/npm/glo.ck', + 'dependencies': { + 'underscore': '1.5.1' } } @@ -110,5 +108,5 @@ function setup () { mkdirp.sync(modules) mkdirp.sync(dep) - cat(resolve(dep, "package.json"), JSON.stringify(fixture)) + cat(resolve(dep, 'package.json'), JSON.stringify(fixture)) } |