diff options
author | Sebastiaan Deckers <seb@ninja.sg> | 2015-10-13 06:12:34 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-10-22 01:16:34 +0300 |
commit | 40c1b0f5cba5c4ecbcea8e9a7def9965682c2701 (patch) | |
tree | bdc117586e05a4f01ba0faed1adbea2eeb2248c4 /test | |
parent | 8946cb3f321995792a3009f6372a6f87e81873ed (diff) |
src: Update formatting to be compatible with standard@5
PR-URL: https://github.com/npm/npm/pull/9954
Diffstat (limited to 'test')
41 files changed, 628 insertions, 600 deletions
diff --git a/test/common-tap.js b/test/common-tap.js index 3537df687..915910a9c 100644 --- a/test/common-tap.js +++ b/test/common-tap.js @@ -68,7 +68,7 @@ exports.makeGitRepo = function (params, cb) { var added = params.added || ['package.json'] var message = params.message || 'stub repo' - var opts = { cwd: root, env: { PATH: process.env.PATH }} + var opts = { cwd: root, env: { PATH: process.env.PATH } } var commands = [ git.chainableExec(['init'], opts), git.chainableExec(['config', 'user.name', user], opts), diff --git a/test/packages/npm-test-array-bin/test.js b/test/packages/npm-test-array-bin/test.js index 984bedb47..f7922dbc7 100644 --- a/test/packages/npm-test-array-bin/test.js +++ b/test/packages/npm-test-array-bin/test.js @@ -1,4 +1,5 @@ require('child_process').exec('array-bin', { env: process.env }, - function (err) { - if (err && err.code) throw new Error('exited badly with code = ' + err.code) -}) + function (err) { + if (err && err.code) throw new Error('exited badly with code = ' + err.code) + } +) diff --git a/test/packages/npm-test-dir-bin/test.js b/test/packages/npm-test-dir-bin/test.js index c59ec92da..1a397061f 100644 --- a/test/packages/npm-test-dir-bin/test.js +++ b/test/packages/npm-test-dir-bin/test.js @@ -1,4 +1,5 @@ -require('child_process').exec('dir-bin', { stdio: 'pipe', - env: process.env }, function (err) { - if (err && err.code) throw new Error('exited badly with code = ' + err.code) -}) +require('child_process').exec('dir-bin', { stdio: 'pipe', env: process.env }, + function (err) { + if (err && err.code) throw new Error('exited badly with code = ' + err.code) + } +) diff --git a/test/packages/npm-test-shrinkwrap/test.js b/test/packages/npm-test-shrinkwrap/test.js index 34638c2ce..e40ae9b65 100644 --- a/test/packages/npm-test-shrinkwrap/test.js +++ b/test/packages/npm-test-shrinkwrap/test.js @@ -6,22 +6,23 @@ delete process.env.npm_config_depth var npm = process.env.npm_execpath -require('child_process').execFile(process.execPath, [npm, 'ls', '--json'], { - stdio: 'pipe', env: process.env, cwd: process.cwd() }, - function (err, stdout, stderr) { - if (err) throw err +require('child_process').execFile(process.execPath, [npm, 'ls', '--json'], + { stdio: 'pipe', env: process.env, cwd: process.cwd() }, + function (err, stdout, stderr) { + if (err) throw err - var actual = JSON.parse(stdout) - var expected = require('./npm-shrinkwrap.json') - rmFrom(actual) - actual = actual.dependencies - rmFrom(expected) - expected = expected.dependencies - console.error(JSON.stringify(actual, null, 2)) - console.error(JSON.stringify(expected, null, 2)) + var actual = JSON.parse(stdout) + var expected = require('./npm-shrinkwrap.json') + rmFrom(actual) + actual = actual.dependencies + rmFrom(expected) + expected = expected.dependencies + console.error(JSON.stringify(actual, null, 2)) + console.error(JSON.stringify(expected, null, 2)) - assert.deepEqual(actual, expected) -}) + assert.deepEqual(actual, expected) + } +) function rmFrom (obj) { for (var i in obj) { diff --git a/test/run.js b/test/run.js index c9eb97569..142facf03 100644 --- a/test/run.js +++ b/test/run.js @@ -12,9 +12,9 @@ var npmcli = path.resolve(npmpkg, 'bin', 'npm-cli.js') var temp = process.env.TMPDIR || process.env.TMP || process.env.TEMP || - (process.platform === 'win32' ? - 'c:\\windows\\temp' : - '/tmp') + (process.platform === 'win32' + ? 'c:\\windows\\temp' + : '/tmp') temp = path.resolve(temp, 'npm-test-' + process.pid) @@ -169,15 +169,15 @@ function main (cb) { function installAndTestEach (cb) { var thingsToChain = [ - setup, - [execChain, flatten(packages.map(function (p) { - return [ - ['npm install packages/' + p, testdir], - ['npm test', path.resolve(base, p)], - ['npm rm ' + p, root] - ] - }))] - ] + setup, + [execChain, flatten(packages.map(function (p) { + return [ + ['npm install packages/' + p, testdir], + ['npm test', path.resolve(base, p)], + ['npm rm ' + p, root] + ] + }))] + ] if (process.platform !== 'win32') { // Windows can't handle npm rm npm due to file-in-use issues. thingsToChain.push([exec, 'npm rm npm', testdir]) diff --git a/test/tap/access.js b/test/tap/access.js index 5e13a23cd..5feb89232 100644 --- a/test/tap/access.js +++ b/test/tap/access.js @@ -41,20 +41,22 @@ test('npm access public on current package', function (t) { })).reply(200, { accessChanged: true }) - common.npm([ - 'access', - 'public', - '--registry', common.registry, - '--loglevel', 'silent' - ], { - cwd: pkg - }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.end() - }) + common.npm( + [ + 'access', + 'public', + '--registry', common.registry, + '--loglevel', 'silent' + ], { + cwd: pkg + }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.end() + } + ) }) test('npm access restricted on current package', function (t) { @@ -63,20 +65,22 @@ test('npm access restricted on current package', function (t) { })).reply(200, { accessChanged: true }) - common.npm([ - 'access', - 'restricted', - '--registry', common.registry, - '--loglevel', 'silent' - ], { - cwd: pkg - }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.end() - }) + common.npm( + [ + 'access', + 'restricted', + '--registry', common.registry, + '--loglevel', 'silent' + ], { + cwd: pkg + }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.end() + } + ) }) test('npm access on named package', function (t) { diff --git a/test/tap/add-named-update-protocol-port.js b/test/tap/add-named-update-protocol-port.js index 52832db0c..5993b07c9 100644 --- a/test/tap/add-named-update-protocol-port.js +++ b/test/tap/add-named-update-protocol-port.js @@ -55,7 +55,6 @@ test('tarball paths should update port if updating protocol', function (t) { t.end() }) }) - }) test('tarball paths should NOT update if different hostname', function (t) { @@ -77,5 +76,4 @@ test('tarball paths should NOT update if different hostname', function (t) { t.end() }) }) - }) diff --git a/test/tap/add-remote-git-get-resolved.js b/test/tap/add-remote-git-get-resolved.js index 3f3146728..dab51d16e 100644 --- a/test/tap/add-remote-git-get-resolved.js +++ b/test/tap/add-remote-git-get-resolved.js @@ -83,7 +83,6 @@ test('add-remote-git#get-resolved HTTPS', function (t) { }) test('add-remote-git#get-resolved edge cases', function (t) { - t.equal( tryGetResolved('git+ssh://user@bananaboat.com:galbi/blah.git', 'decadacefadabade'), 'git+ssh://user@bananaboat.com:galbi/blah.git#decadacefadabade', diff --git a/test/tap/adduser-always-auth.js b/test/tap/adduser-always-auth.js index 3ec819000..cca560b1f 100644 --- a/test/tap/adduser-always-auth.js +++ b/test/tap/adduser-always-auth.js @@ -27,12 +27,12 @@ function mocks (server) { test('npm login', function (t) { mr({ port: common.port, plugin: mocks }, function (er, s) { var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile - ], + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile + ], opts, function (err, code) { t.notOk(code, 'exited OK') @@ -65,13 +65,13 @@ test('npm login', function (t) { test('npm login --always-auth', function (t) { mr({ port: common.port, plugin: mocks }, function (er, s) { var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile, - '--always-auth' - ], + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile, + '--always-auth' + ], opts, function (err, code) { t.notOk(code, 'exited OK') @@ -104,13 +104,13 @@ test('npm login --always-auth', function (t) { test('npm login --no-always-auth', function (t) { mr({ port: common.port, plugin: mocks }, function (er, s) { var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile, - '--no-always-auth' - ], + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile, + '--no-always-auth' + ], opts, function (err, code) { t.notOk(code, 'exited OK') diff --git a/test/tap/adduser-legacy-auth.js b/test/tap/adduser-legacy-auth.js index 885a685b9..3fa03e7d3 100644 --- a/test/tap/adduser-legacy-auth.js +++ b/test/tap/adduser-legacy-auth.js @@ -53,25 +53,26 @@ test('setup', function (t) { test('npm login', function (t) { mr({ port: common.port, plugin: mocks }, function (er, s) { var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, /:always-auth=false/, 'always-auth is scoped and false (by default)') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm ran without issue') + t.notOk(code, 'exited OK') + t.notOk(stderr, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, /:always-auth=false/, 'always-auth is scoped and false (by default)') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) + } + ) var o = '' var e = '' diff --git a/test/tap/bugs.js b/test/tap/bugs.js index a0a3be1b8..dd2c87e2c 100644 --- a/test/tap/bugs.js +++ b/test/tap/bugs.js @@ -26,121 +26,145 @@ test('setup', function (t) { test('npm bugs underscore', function (t) { mr({ port: common.port }, function (er, s) { - common.npm([ - 'bugs', 'underscore', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(__dirname, '/_script.sh') - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://github.com/jashkenas/underscore/issues\n') - rimraf.sync(outFile) - t.end() - }) + common.npm( + [ + 'bugs', 'underscore', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://github.com/jashkenas/underscore/issues\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) test('npm bugs optimist - github (https://)', function (t) { mr({ port: common.port }, function (er, s) { - common.npm([ - 'bugs', 'optimist', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(__dirname, '/_script.sh') - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://github.com/substack/node-optimist/issues\n') - rimraf.sync(outFile) - t.end() - }) + common.npm( + [ + 'bugs', 'optimist', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://github.com/substack/node-optimist/issues\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) test('npm bugs npm-test-peer-deps - no repo', function (t) { mr({ port: common.port }, function (er, s) { - common.npm([ - 'bugs', 'npm-test-peer-deps', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(__dirname, '/_script.sh') - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://www.npmjs.org/package/npm-test-peer-deps\n') - rimraf.sync(outFile) - t.end() - }) + common.npm( + [ + 'bugs', 'npm-test-peer-deps', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://www.npmjs.org/package/npm-test-peer-deps\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) test('npm bugs test-repo-url-http - non-github (http://)', function (t) { mr({ port: common.port }, function (er, s) { - common.npm([ - 'bugs', 'test-repo-url-http', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(__dirname, '/_script.sh') - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://www.npmjs.org/package/test-repo-url-http\n') - rimraf.sync(outFile) - t.end() - }) + common.npm( + [ + 'bugs', 'test-repo-url-http', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://www.npmjs.org/package/test-repo-url-http\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) test('npm bugs test-repo-url-https - non-github (https://)', function (t) { mr({ port: common.port }, function (er, s) { - common.npm([ - 'bugs', 'test-repo-url-https', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(__dirname, '/_script.sh') - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://www.npmjs.org/package/test-repo-url-https\n') - rimraf.sync(outFile) - t.end() - }) + common.npm( + [ + 'bugs', 'test-repo-url-https', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://www.npmjs.org/package/test-repo-url-https\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) test('npm bugs test-repo-url-ssh - non-github (ssh://)', function (t) { mr({ port: common.port }, function (er, s) { - common.npm([ - 'bugs', 'test-repo-url-ssh', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(__dirname, '/_script.sh') - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://www.npmjs.org/package/test-repo-url-ssh\n') - rimraf.sync(outFile) - t.end() - }) + common.npm( + [ + 'bugs', 'test-repo-url-ssh', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://www.npmjs.org/package/test-repo-url-ssh\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) diff --git a/test/tap/build-already-built.js b/test/tap/build-already-built.js index 45aa1ba1c..8a66f66e6 100644 --- a/test/tap/build-already-built.js +++ b/test/tap/build-already-built.js @@ -36,7 +36,6 @@ test("issue #6735 build 'already built' message", function (t) { }) t.test('pin previous behavior', function (t) { - build([fakePkg], global, false, false, function (err) { t.ok(err, 'build failed as expected') t.similar(err.message, /package.json/, 'missing package.json as expected') @@ -47,7 +46,6 @@ test("issue #6735 build 'already built' message", function (t) { }) t.test('simulate rebuild of bundledDependency', function (t) { - log = '' build._didBuild[folder] = true diff --git a/test/tap/builtin-config.js b/test/tap/builtin-config.js index 333282e68..bb08767c5 100644 --- a/test/tap/builtin-config.js +++ b/test/tap/builtin-config.js @@ -54,10 +54,10 @@ test('write npmrc file', function (t) { ], {'stdio': 'inherit'}, function (er, code) { - if (er) throw er - t.equal(code, 0) - t.end() - }) + if (er) throw er + t.equal(code, 0) + t.end() + }) }) test('use first npm to install second npm', function (t) { @@ -104,26 +104,28 @@ test('verify that the builtin config matches', function (t) { '--prefix=' + folder + '/first', '--cache=' + folder + '/cache', '--tmp=' + folder + '/tmp' - ], {}, function (er, code, so) { - if (er) throw er - t.equal(code, 0) - var firstRoot = so.trim() - common.npm([ 'root', '-g', - '--prefix=' + folder + '/second', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp' - ], {}, function (er, code, so) { - if (er) throw er - t.equal(code, 0) - var secondRoot = so.trim() - var firstRc = path.resolve(firstRoot, 'npm', 'npmrc') - var secondRc = path.resolve(secondRoot, 'npm', 'npmrc') - var firstData = fs.readFileSync(firstRc, 'utf8') - var secondData = fs.readFileSync(secondRc, 'utf8') - t.equal(firstData, secondData) - t.end() - }) - }) + ], {}, + function (er, code, so) { + if (er) throw er + t.equal(code, 0) + var firstRoot = so.trim() + common.npm([ 'root', '-g', + '--prefix=' + folder + '/second', + '--cache=' + folder + '/cache', + '--tmp=' + folder + '/tmp' + ], {}, + function (er, code, so) { + if (er) throw er + t.equal(code, 0) + var secondRoot = so.trim() + var firstRc = path.resolve(firstRoot, 'npm', 'npmrc') + var secondRc = path.resolve(secondRoot, 'npm', 'npmrc') + var firstData = fs.readFileSync(firstRc, 'utf8') + var secondData = fs.readFileSync(secondRc, 'utf8') + t.equal(firstData, secondData) + t.end() + }) + }) }) test('clean', function (t) { diff --git a/test/tap/cache-add-localdir-fallback.js b/test/tap/cache-add-localdir-fallback.js index ca8696d22..2845d11ec 100644 --- a/test/tap/cache-add-localdir-fallback.js +++ b/test/tap/cache-add-localdir-fallback.js @@ -8,35 +8,35 @@ var realizePackageSpecifier = requireInject('realize-package-specifier', { stat: function (file, cb) { process.nextTick(function () { switch (file) { - case path.resolve('named'): - cb(new Error('ENOENT')) - break - case path.resolve('file.tgz'): - cb(null, { isDirectory: function () { return false } }) - break - case path.resolve('dir-no-package'): - cb(null, { isDirectory: function () { return true } }) - break - case path.resolve('dir-no-package/package.json'): - cb(new Error('ENOENT')) - break - case path.resolve('dir-with-package'): - cb(null, { isDirectory: function () { return true } }) - break - case path.resolve('dir-with-package/package.json'): - cb(null, {}) - break - case path.resolve(__dirname, 'dir-with-package'): - cb(null, { isDirectory: function () { return true } }) - break - case path.join(__dirname, 'dir-with-package', 'package.json'): - cb(null, {}) - break - case path.resolve(__dirname, 'file.tgz'): - cb(null, { isDirectory: function () { return false } }) - break - default: - throw new Error('Unknown test file passed to stat: ' + file) + case path.resolve('named'): + cb(new Error('ENOENT')) + break + case path.resolve('file.tgz'): + cb(null, { isDirectory: function () { return false } }) + break + case path.resolve('dir-no-package'): + cb(null, { isDirectory: function () { return true } }) + break + case path.resolve('dir-no-package/package.json'): + cb(new Error('ENOENT')) + break + case path.resolve('dir-with-package'): + cb(null, { isDirectory: function () { return true } }) + break + case path.resolve('dir-with-package/package.json'): + cb(null, {}) + break + case path.resolve(__dirname, 'dir-with-package'): + cb(null, { isDirectory: function () { return true } }) + break + case path.join(__dirname, 'dir-with-package', 'package.json'): + cb(null, {}) + break + case path.resolve(__dirname, 'file.tgz'): + cb(null, { isDirectory: function () { return false } }) + break + default: + throw new Error('Unknown test file passed to stat: ' + file) } }) } diff --git a/test/tap/cache-add-unpublished.js b/test/tap/cache-add-unpublished.js index fe6807f19..0d39ad815 100644 --- a/test/tap/cache-add-unpublished.js +++ b/test/tap/cache-add-unpublished.js @@ -6,19 +6,23 @@ test('cache add', function (t) { if (er) { throw er } - common.npm([ - 'cache', - 'add', - 'superfoo', - '--registry=http://localhost:1337/' - ], {}, function (er, c, so, se) { - if (er) throw er - t.ok(c, 'got non-zero exit code') - t.equal(so, '', 'nothing printed to stdout') - t.similar(se, /404 Not Found: superfoo/, 'got expected error') - s.close() - t.end() - }) + common.npm( + [ + 'cache', + 'add', + 'superfoo', + '--registry=http://localhost:1337/' + ], + {}, + function (er, c, so, se) { + if (er) throw er + t.ok(c, 'got non-zero exit code') + t.equal(so, '', 'nothing printed to stdout') + t.similar(se, /404 Not Found: superfoo/, 'got expected error') + s.close() + t.end() + } + ) }) }) diff --git a/test/tap/config-private.js b/test/tap/config-private.js index 97c6a73f1..91582921e 100644 --- a/test/tap/config-private.js +++ b/test/tap/config-private.js @@ -15,7 +15,8 @@ test('setup', function (t) { }) test('config get private var (old auth)', function (t) { - common.npm([ + common.npm( + [ 'config', 'get', '_auth' @@ -32,7 +33,8 @@ test('config get private var (old auth)', function (t) { }) test('config get private var (new auth)', function (t) { - common.npm([ + common.npm( + [ 'config', 'get', '//registry.npmjs.org/:_password' diff --git a/test/tap/dedupe.js b/test/tap/dedupe.js index 4c3424818..bdda3474a 100644 --- a/test/tap/dedupe.js +++ b/test/tap/dedupe.js @@ -58,8 +58,7 @@ test('setup', function (t) { }) test('dedupe finds the common module and moves it up one level', function (t) { - common.npm( - [ + common.npm([ '--registry', common.registry, 'install', '.' ], diff --git a/test/tap/gently-rm-cmdshims.js b/test/tap/gently-rm-cmdshims.js index ebe0b7d7a..ea1f47a0d 100644 --- a/test/tap/gently-rm-cmdshims.js +++ b/test/tap/gently-rm-cmdshims.js @@ -127,28 +127,30 @@ test('remove-cmd-shims', function (t) { var gentlyRm = require('../../lib/utils/gently-rm.js') runAll([ [gentlyRm, doremove_example_cmd, true, doremove_module], - [gentlyRm, doremove_example_cygwin, true, doremove_module] ], function () { - fs.stat(doremove_example_cmd, function (er) { - t.is(er && er.code, 'ENOENT', 'cmd-shim was removed') - }) - fs.stat(doremove_example_cygwin, function (er) { - t.is(er && er.code, 'ENOENT', 'cmd-shim cygwin script was removed') - }) - }) + [gentlyRm, doremove_example_cygwin, true, doremove_module] ], + function () { + fs.stat(doremove_example_cmd, function (er) { + t.is(er && er.code, 'ENOENT', 'cmd-shim was removed') + }) + fs.stat(doremove_example_cygwin, function (er) { + t.is(er && er.code, 'ENOENT', 'cmd-shim cygwin script was removed') + }) + }) }) test('dont-remove-cmd-shims', function (t) { t.plan(2) var gentlyRm = require('../../lib/utils/gently-rm.js') runAll([ [gentlyRm, dontremove_example_cmd, true, dontremove_module], - [gentlyRm, dontremove_example_cygwin, true, dontremove_module] ], function () { - fs.stat(dontremove_example_cmd, function (er) { - t.is(er, null, 'cmd-shim was not removed') - }) - fs.stat(dontremove_example_cygwin, function (er) { - t.is(er, null, 'cmd-shim cygwin script was not removed') - }) - }) + [gentlyRm, dontremove_example_cygwin, true, dontremove_module] ], + function () { + fs.stat(dontremove_example_cmd, function (er) { + t.is(er, null, 'cmd-shim was not removed') + }) + fs.stat(dontremove_example_cygwin, function (er) { + t.is(er, null, 'cmd-shim cygwin script was not removed') + }) + }) }) test('cleanup', function (t) { diff --git a/test/tap/git-cache-no-hooks.js b/test/tap/git-cache-no-hooks.js index e5d862919..cfc2d1dc6 100644 --- a/test/tap/git-cache-no-hooks.js +++ b/test/tap/git-cache-no-hooks.js @@ -20,7 +20,6 @@ test('setup', function (t) { }) test('git-cache-no-hooks: install a git dependency', function (t) { - // disable git integration tests on Travis. if (process.env.TRAVIS) return t.end() diff --git a/test/tap/git-dependency-install-link.js b/test/tap/git-dependency-install-link.js index 1eba7ff85..15f43e7bb 100644 --- a/test/tap/git-dependency-install-link.js +++ b/test/tap/git-dependency-install-link.js @@ -123,47 +123,47 @@ function setup (cb) { prefix: pkg, loglevel: 'silent' }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - var d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--port=1234' - ], - { - cwd: pkg, - env: process.env, - stdio: ['pipe', 'pipe', 'pipe'] - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - cb(null, [d, cpid[1]]) - } + git = require('../../lib/utils/git.js') + + function startDaemon (cb) { + // start git server + var d = git.spawn( + [ + 'daemon', + '--verbose', + '--listen=localhost', + '--export-all', + '--base-path=.', + '--port=1234' + ], + { + cwd: pkg, + env: process.env, + stdio: ['pipe', 'pipe', 'pipe'] + } + ) + d.stderr.on('data', childFinder) + + function childFinder (c) { + var cpid = c.toString().match(/^\[(\d+)\]/) + if (cpid[1]) { + this.removeListener('data', childFinder) + cb(null, [d, cpid[1]]) } } + } - common.makeGitRepo({ - path: repo, - commands: [ - git.chainableExec( - ['clone', '--bare', repo, 'child.git'], - { cwd: pkg, env: process.env } - ), - startDaemon - ] - }, cb) - }) + common.makeGitRepo({ + path: repo, + commands: [ + git.chainableExec( + ['clone', '--bare', repo, 'child.git'], + { cwd: pkg, env: process.env } + ), + startDaemon + ] + }, cb) + }) } function cleanup () { diff --git a/test/tap/git-races.js b/test/tap/git-races.js index cdab7c346..6bbfe78bd 100644 --- a/test/tap/git-races.js +++ b/test/tap/git-races.js @@ -210,4 +210,3 @@ test('correct versions are installed for git dependency', function (t) { }) }) }) - diff --git a/test/tap/init-interrupt.js b/test/tap/init-interrupt.js index 2e85a5d1b..799ff0716 100644 --- a/test/tap/init-interrupt.js +++ b/test/tap/init-interrupt.js @@ -18,7 +18,6 @@ test('setup', function (t) { }) test('issue #6684 remove confusing message', function (t) { - var initJsonMock = function (dir, input, config, cb) { process.nextTick(function () { cb({ message: 'canceled' }) diff --git a/test/tap/install-cli-only-development.js b/test/tap/install-cli-only-development.js index 6a5995e7e..ff9d05f54 100644 --- a/test/tap/install-cli-only-development.js +++ b/test/tap/install-cli-only-development.js @@ -62,7 +62,6 @@ test('\'npm install --only=development\' should only install devDependencies', f }) test('\'npm install --only=development\' should only install devDependencies regardless of npm.config.get(\'production\')', function (t) { - cleanup() setup() diff --git a/test/tap/logout.js b/test/tap/logout.js index 3a62cc273..ebe0f51ba 100644 --- a/test/tap/logout.js +++ b/test/tap/logout.js @@ -33,22 +33,23 @@ test('npm logout', function (t) { if (err) throw err common.npm( - [ - 'logout', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile - ], - opts, - function (err, code) { - t.ifError(err, 'no error output') - t.notOk(code, 'exited OK') + [ + 'logout', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile + ], + opts, + function (err, code) { + t.ifError(err, 'no error output') + t.notOk(code, 'exited OK') - var config = fs.readFileSync(outfile, 'utf8') - t.equal(config, 'foo=boo\n', 'creds gone') - s.close() - t.end() - }) + var config = fs.readFileSync(outfile, 'utf8') + t.equal(config, 'foo=boo\n', 'creds gone') + s.close() + t.end() + } + ) }) }) diff --git a/test/tap/outdated-color.js b/test/tap/outdated-color.js index b35070c45..a0da33702 100644 --- a/test/tap/outdated-color.js +++ b/test/tap/outdated-color.js @@ -50,10 +50,10 @@ test('does not use ansi styling', function (t) { t.plan(4) mr({ port: common.port }, function (er, s) { // create mock registry. common.npm( - [ - '--registry', common.registry, - 'outdated', 'underscore' - ], + [ + '--registry', common.registry, + 'outdated', 'underscore' + ], EXEC_OPTS, function (err, code, stdout) { t.ifError(err) diff --git a/test/tap/outdated-depth-integer.js b/test/tap/outdated-depth-integer.js index ddd2dd7c3..a1fc2b99d 100644 --- a/test/tap/outdated-depth-integer.js +++ b/test/tap/outdated-depth-integer.js @@ -58,17 +58,16 @@ test('outdated depth integer', function (t) { depth: 5 } , function () { - npm.install('request@0.9.0', function (er) { - if (er) throw new Error(er) - npm.outdated(function (err, d) { - if (err) throw new Error(err) - t.deepEqual(d, expected) - s.close() - t.end() - }) + npm.install('request@0.9.0', function (er) { + if (er) throw new Error(er) + npm.outdated(function (err, d) { + if (err) throw new Error(err) + t.deepEqual(d, expected) + s.close() + t.end() }) - } - ) + }) + }) }) }) diff --git a/test/tap/outdated-notarget.js b/test/tap/outdated-notarget.js index 5fd2b0634..14388a80b 100644 --- a/test/tap/outdated-notarget.js +++ b/test/tap/outdated-notarget.js @@ -15,7 +15,7 @@ test('outdated-target: if no viable version is found, show error', function (t) t.plan(1) setup() mr({ port: common.port }, function (er, s) { - npm.load({ cache: cache, registry: common.registry}, function () { + npm.load({ cache: cache, registry: common.registry }, function () { npm.commands.update(function (er) { t.equal(er.code, 'ETARGET') s.close() diff --git a/test/tap/peer-deps-toplevel.js b/test/tap/peer-deps-toplevel.js index 61c3ecb0d..1c9586730 100644 --- a/test/tap/peer-deps-toplevel.js +++ b/test/tap/peer-deps-toplevel.js @@ -105,7 +105,7 @@ function setup (cb) { ) process.chdir(pkg) - var opts = { cache: path.resolve(pkg, 'cache'), registry: common.registry} + var opts = { cache: path.resolve(pkg, 'cache'), registry: common.registry } npm.load(opts, cb) } diff --git a/test/tap/peer-deps.js b/test/tap/peer-deps.js index 7116e428b..c319c32e4 100644 --- a/test/tap/peer-deps.js +++ b/test/tap/peer-deps.js @@ -57,7 +57,7 @@ function setup (cb) { ) process.chdir(pkg) - var opts = { cache: path.resolve(pkg, 'cache'), registry: common.registry} + var opts = { cache: path.resolve(pkg, 'cache'), registry: common.registry } npm.load(opts, cb) } diff --git a/test/tap/prepublish.js b/test/tap/prepublish.js index f065a656a..556d01ebb 100644 --- a/test/tap/prepublish.js +++ b/test/tap/prepublish.js @@ -53,9 +53,9 @@ test('test', function (t) { } common.npm([ - 'pack', - '--loglevel', 'warn' - ], { cwd: pkg, env: env }, function (err, code, stdout, stderr) { + 'pack', + '--loglevel', 'warn' + ], { cwd: pkg, env: env }, function (err, code, stdout, stderr) { t.equal(code, 0, 'pack finished successfully') t.ifErr(err, 'pack finished successfully') diff --git a/test/tap/publish-invalid-semver-tag.js b/test/tap/publish-invalid-semver-tag.js index 1a741d348..21543869a 100644 --- a/test/tap/publish-invalid-semver-tag.js +++ b/test/tap/publish-invalid-semver-tag.js @@ -39,11 +39,11 @@ test('setup', function (t) { registry: common.registry, cwd: PKG_DIR }, function (err) { - t.ifError(err, 'started server') - mockServer = server + t.ifError(err, 'started server') + mockServer = server - t.end() - }) + t.end() + }) }) }) diff --git a/test/tap/registry.js b/test/tap/registry.js index 7ff4075bf..61ed0d0aa 100644 --- a/test/tap/registry.js +++ b/test/tap/registry.js @@ -42,7 +42,6 @@ function runTests () { t.fail('install failed with: ' + code) t.end() }) - } else { opts = { cwd: ca, diff --git a/test/tap/scripts-whitespace-windows.js b/test/tap/scripts-whitespace-windows.js index f23f06257..5aa7d0084 100644 --- a/test/tap/scripts-whitespace-windows.js +++ b/test/tap/scripts-whitespace-windows.js @@ -99,4 +99,3 @@ function cleanup () { process.chdir(osenv.tmpdir()) rimraf.sync(pkg) } - diff --git a/test/tap/search.js b/test/tap/search.js index 0412e1755..08cc7a6fe 100644 --- a/test/tap/search.js +++ b/test/tap/search.js @@ -180,97 +180,97 @@ function stringifyUpdated (time) { var allMock = { '_updated': timeMock.all, 'generator-frontcow': { - 'name': 'generator-frontcow', - 'description': 'f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache', - 'dist-tags': { - 'latest': '0.1.19' - }, - 'maintainers': [ - { - 'name': 'bcabanes', - 'email': 'contact@benjamincabanes.com' - } - ], - 'homepage': 'https://github.com/bcabanes/generator-frontcow', - 'keywords': [ - 'sass', - 'frontend', - 'yeoman-generator', - 'atomic', - 'design', - 'sass', - 'foundation', - 'foundation5', - 'atomic design', - 'bourbon', - 'polyfill', - 'font awesome' - ], - 'repository': { - 'type': 'git', - 'url': 'https://github.com/bcabanes/generator-frontcow' - }, - 'author': { - 'name': 'ben', - 'email': 'contact@benjamincabanes.com', - 'url': 'https://github.com/bcabanes' - }, - 'bugs': { - 'url': 'https://github.com/bcabanes/generator-frontcow/issues' - }, - 'license': 'MIT', - 'readmeFilename': 'README.md', - 'time': { - 'modified': '2014-10-03T02:26:18.406Z' - }, - 'versions': { - '0.1.19': 'latest' + 'name': 'generator-frontcow', + 'description': 'f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache', + 'dist-tags': { + 'latest': '0.1.19' + }, + 'maintainers': [ + { + 'name': 'bcabanes', + 'email': 'contact@benjamincabanes.com' } + ], + 'homepage': 'https://github.com/bcabanes/generator-frontcow', + 'keywords': [ + 'sass', + 'frontend', + 'yeoman-generator', + 'atomic', + 'design', + 'sass', + 'foundation', + 'foundation5', + 'atomic design', + 'bourbon', + 'polyfill', + 'font awesome' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/bcabanes/generator-frontcow' + }, + 'author': { + 'name': 'ben', + 'email': 'contact@benjamincabanes.com', + 'url': 'https://github.com/bcabanes' + }, + 'bugs': { + 'url': 'https://github.com/bcabanes/generator-frontcow/issues' + }, + 'license': 'MIT', + 'readmeFilename': 'README.md', + 'time': { + 'modified': '2014-10-03T02:26:18.406Z' + }, + 'versions': { + '0.1.19': 'latest' + } }, 'marko': { - 'name': 'marko', - 'description': 'Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.', - 'dist-tags': { - 'latest': '1.2.16' + 'name': 'marko', + 'description': 'Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.', + 'dist-tags': { + 'latest': '1.2.16' + }, + 'maintainers': [ + { + 'name': 'pnidem', + 'email': 'pnidem@gmail.com' }, - 'maintainers': [ - { - 'name': 'pnidem', - 'email': 'pnidem@gmail.com' - }, - { - 'name': 'philidem', - 'email': 'phillip.idem@gmail.com' - } - ], - 'homepage': 'https://github.com/raptorjs/marko', - 'keywords': [ - 'templating', - 'template', - 'async', - 'streaming' - ], - 'repository': { - 'type': 'git', - 'url': 'https://github.com/raptorjs/marko.git' - }, - 'author': { - 'name': 'Patrick Steele-Idem', - 'email': 'pnidem@gmail.com' - }, - 'bugs': { - 'url': 'https://github.com/raptorjs/marko/issues' - }, - 'license': 'Apache License v2.0', - 'readmeFilename': 'README.md', - 'users': { - 'pnidem': true - }, - 'time': { - 'modified': '2014-10-03T02:27:31.775Z' - }, - 'versions': { - '1.2.16': 'latest' + { + 'name': 'philidem', + 'email': 'phillip.idem@gmail.com' } + ], + 'homepage': 'https://github.com/raptorjs/marko', + 'keywords': [ + 'templating', + 'template', + 'async', + 'streaming' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/raptorjs/marko.git' + }, + 'author': { + 'name': 'Patrick Steele-Idem', + 'email': 'pnidem@gmail.com' + }, + 'bugs': { + 'url': 'https://github.com/raptorjs/marko/issues' + }, + 'license': 'Apache License v2.0', + 'readmeFilename': 'README.md', + 'users': { + 'pnidem': true + }, + 'time': { + 'modified': '2014-10-03T02:27:31.775Z' + }, + 'versions': { + '1.2.16': 'latest' + } } } diff --git a/test/tap/shrinkwrap-optional-dependency.js b/test/tap/shrinkwrap-optional-dependency.js index c083e9fe4..ee44b9a7b 100644 --- a/test/tap/shrinkwrap-optional-dependency.js +++ b/test/tap/shrinkwrap-optional-dependency.js @@ -22,7 +22,6 @@ test('shrinkwrap does not fail on missing optional dependency', function (t) { } mr({port: common.port, mocks: mocks}, function (er, s) { - function fail (err) { s.close() // Close on failure to allow node to exit t.fail(err) diff --git a/test/tap/tag-version-prefix.js b/test/tap/tag-version-prefix.js index f4ba32b12..9035e9fbd 100644 --- a/test/tap/tag-version-prefix.js +++ b/test/tap/tag-version-prefix.js @@ -25,49 +25,48 @@ test('npm version <semver> with message config', function (t) { var git = require('../../lib/utils/git.js') common.makeGitRepo({ path: pkg }, function (er) { - t.ifErr(er, 'git bootstrap ran without error') - - common.npm( - [ - '--userconfig', npmrc, - 'config', - 'set', - 'tag-version-prefix', - 'q' - ], - { cwd: pkg, env: { PATH: process.env.PATH } }, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm config ran without issue') - t.notOk(code, 'exited with a non-error code') - t.notOk(stderr, 'no error output') - - common.npm( - [ - 'version', - 'patch', - '--loglevel', 'silent' - // package config is picked up from env - ], - { cwd: pkg, env: { PATH: process.env.PATH } }, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm version ran without issue') - t.notOk(code, 'exited with a non-error code') - t.notOk(stderr, 'no error output') - - git.whichAndExec( - ['tag'], - { cwd: pkg, env: process.env }, - function (er, tags, stderr) { - t.ok(tags.match(/q0\.1\.3/g), 'tag was created by version' + tags) - t.end() - } - ) - } - ) - } - ) - } - ) + t.ifErr(er, 'git bootstrap ran without error') + + common.npm( + [ + '--userconfig', npmrc, + 'config', + 'set', + 'tag-version-prefix', + 'q' + ], + { cwd: pkg, env: { PATH: process.env.PATH } }, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm config ran without issue') + t.notOk(code, 'exited with a non-error code') + t.notOk(stderr, 'no error output') + + common.npm( + [ + 'version', + 'patch', + '--loglevel', 'silent' + // package config is picked up from env + ], + { cwd: pkg, env: { PATH: process.env.PATH } }, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm version ran without issue') + t.notOk(code, 'exited with a non-error code') + t.notOk(stderr, 'no error output') + + git.whichAndExec( + ['tag'], + { cwd: pkg, env: process.env }, + function (er, tags, stderr) { + t.ok(tags.match(/q0\.1\.3/g), 'tag was created by version' + tags) + t.end() + } + ) + } + ) + } + ) + }) }) }) diff --git a/test/tap/update-examples.js b/test/tap/update-examples.js index ae67e4a91..548447895 100644 --- a/test/tap/update-examples.js +++ b/test/tap/update-examples.js @@ -150,19 +150,19 @@ test('setup', function (t) { npm.load({ cache: CACHE_DIR, registry: common.registry, cwd: PKG_DIR }, function (err) { - t.ifError(err, 'started server') - mockServer = server + t.ifError(err, 'started server') + mockServer = server - t.pass('npm.load complete') + t.pass('npm.load complete') - mockCommand(npm, 'install', function mockInstall (where, what, cb) { - installAskedFor = what - cb(null) - }) - - t.pass('mocks configured') - t.end() + mockCommand(npm, 'install', function mockInstall (where, what, cb) { + installAskedFor = what + cb(null) }) + + t.pass('mocks configured') + t.end() + }) }) }) diff --git a/test/tap/update-index.js b/test/tap/update-index.js index fe4244c30..91b2f7878 100644 --- a/test/tap/update-index.js +++ b/test/tap/update-index.js @@ -31,98 +31,98 @@ var mocks = { var allMock = { '_updated': 1411727900 + 25, 'generator-frontcow': { - 'name': 'generator-frontcow', - 'description': 'f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache', - 'dist-tags': { - 'latest': '0.1.19' - }, - 'maintainers': [ - { - 'name': 'bcabanes', - 'email': 'contact@benjamincabanes.com' - } - ], - 'homepage': 'https://github.com/bcabanes/generator-frontcow', - 'keywords': [ - 'sass', - 'frontend', - 'yeoman-generator', - 'atomic', - 'design', - 'sass', - 'foundation', - 'foundation5', - 'atomic design', - 'bourbon', - 'polyfill', - 'font awesome' - ], - 'repository': { - 'type': 'git', - 'url': 'https://github.com/bcabanes/generator-frontcow' - }, - 'author': { - 'name': 'ben', - 'email': 'contact@benjamincabanes.com', - 'url': 'https://github.com/bcabanes' - }, - 'bugs': { - 'url': 'https://github.com/bcabanes/generator-frontcow/issues' - }, - 'license': 'MIT', - 'readmeFilename': 'README.md', - 'time': { - 'modified': '2014-10-03T02:26:18.406Z' - }, - 'versions': { - '0.1.19': 'latest' + 'name': 'generator-frontcow', + 'description': 'f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache', + 'dist-tags': { + 'latest': '0.1.19' + }, + 'maintainers': [ + { + 'name': 'bcabanes', + 'email': 'contact@benjamincabanes.com' } + ], + 'homepage': 'https://github.com/bcabanes/generator-frontcow', + 'keywords': [ + 'sass', + 'frontend', + 'yeoman-generator', + 'atomic', + 'design', + 'sass', + 'foundation', + 'foundation5', + 'atomic design', + 'bourbon', + 'polyfill', + 'font awesome' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/bcabanes/generator-frontcow' + }, + 'author': { + 'name': 'ben', + 'email': 'contact@benjamincabanes.com', + 'url': 'https://github.com/bcabanes' + }, + 'bugs': { + 'url': 'https://github.com/bcabanes/generator-frontcow/issues' + }, + 'license': 'MIT', + 'readmeFilename': 'README.md', + 'time': { + 'modified': '2014-10-03T02:26:18.406Z' + }, + 'versions': { + '0.1.19': 'latest' + } }, 'marko': { - 'name': 'marko', - 'description': 'Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.', - 'dist-tags': { - 'latest': '1.2.16' - }, - 'maintainers': [ - { - 'name': 'pnidem', - 'email': 'pnidem@gmail.com' - }, - { - 'name': 'philidem', - 'email': 'phillip.idem@gmail.com' - } - ], - 'homepage': 'https://github.com/raptorjs/marko', - 'keywords': [ - 'templating', - 'template', - 'async', - 'streaming' - ], - 'repository': { - 'type': 'git', - 'url': 'https://github.com/raptorjs/marko.git' - }, - 'author': { - 'name': 'Patrick Steele-Idem', - 'email': 'pnidem@gmail.com' - }, - 'bugs': { - 'url': 'https://github.com/raptorjs/marko/issues' - }, - 'license': 'Apache License v2.0', - 'readmeFilename': 'README.md', - 'users': { - 'pnidem': true - }, - 'time': { - 'modified': '2014-10-03T02:27:31.775Z' + 'name': 'marko', + 'description': 'Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.', + 'dist-tags': { + 'latest': '1.2.16' + }, + 'maintainers': [ + { + 'name': 'pnidem', + 'email': 'pnidem@gmail.com' }, - 'versions': { - '1.2.16': 'latest' + { + 'name': 'philidem', + 'email': 'phillip.idem@gmail.com' } + ], + 'homepage': 'https://github.com/raptorjs/marko', + 'keywords': [ + 'templating', + 'template', + 'async', + 'streaming' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/raptorjs/marko.git' + }, + 'author': { + 'name': 'Patrick Steele-Idem', + 'email': 'pnidem@gmail.com' + }, + 'bugs': { + 'url': 'https://github.com/raptorjs/marko/issues' + }, + 'license': 'Apache License v2.0', + 'readmeFilename': 'README.md', + 'users': { + 'pnidem': true + }, + 'time': { + 'modified': '2014-10-03T02:27:31.775Z' + }, + 'versions': { + '1.2.16': 'latest' + } } } diff --git a/test/tap/version-no-tags.js b/test/tap/version-no-tags.js index ed2bed32c..755e640c0 100644 --- a/test/tap/version-no-tags.js +++ b/test/tap/version-no-tags.js @@ -14,7 +14,7 @@ var cache = path.resolve(pkg, 'cache') test('npm version <semver> without git tag', function (t) { setup() - npm.load({ cache: cache, registry: common.registry}, function () { + npm.load({ cache: cache, registry: common.registry }, function () { which('git', function (err, git) { t.ifError(err, 'git found on system') function tagExists (tag, _cb) { diff --git a/test/tap/version-update-shrinkwrap.js b/test/tap/version-update-shrinkwrap.js index acf6cca8e..c51ab2cb0 100644 --- a/test/tap/version-update-shrinkwrap.js +++ b/test/tap/version-update-shrinkwrap.js @@ -48,7 +48,7 @@ test('npm version <semver> updates git works with no shrinkwrap', function (t) { var shrinkwrap = require(path.resolve(pkg, 'npm-shrinkwrap.json')) t.equal(shrinkwrap.version, '0.0.1', 'got expected version') - var opts = { cwd: pkg, env: { PATH: process.env.PATH }} + var opts = { cwd: pkg, env: { PATH: process.env.PATH } } var git = require('../../lib/utils/git.js') git.whichAndExec( ['show', 'HEAD', '--name-only'], @@ -91,7 +91,7 @@ test('npm version <semver> updates shrinkwrap and updates git', function (t) { t.equal(shrinkwrap.version, '0.0.1', 'got expected version') var git = require('../../lib/utils/git.js') - var opts = { cwd: pkg, env: { PATH: process.env.PATH }} + var opts = { cwd: pkg, env: { PATH: process.env.PATH } } git.whichAndExec( ['show', 'HEAD', '--name-only'], opts, diff --git a/test/tap/view.js b/test/tap/view.js index 84a0a69d3..f54fe93a1 100644 --- a/test/tap/view.js +++ b/test/tap/view.js @@ -84,7 +84,7 @@ test('npm view . with no package.json', function (t) { test('npm view . with no published package', function (t) { process.chdir(t3dir) - mr({ port: common.port, plugin: plugin}, function (er, s) { + mr({ port: common.port, plugin: plugin }, function (er, s) { common.npm([ 'view', '.', @@ -280,9 +280,9 @@ test('npm view with invalid package name', function (t) { test('npm view with valid but non existent package name', function (t) { mr({ port: common.port, mocks: { - 'get': { - '/valid-but-non-existent-package': [404, {'error': 'not found'}] - } + 'get': { + '/valid-but-non-existent-package': [404, {'error': 'not found'}] + } }}, function (er, s) { common.npm([ 'view', |