diff options
-rw-r--r-- | test/disabled/outdated-depth-integer/README.md | 1 | ||||
-rw-r--r-- | test/disabled/outdated-depth-integer/index.js | 1 | ||||
-rw-r--r-- | test/disabled/outdated-depth-integer/package.json | 10 | ||||
-rw-r--r-- | test/tap/outdated-depth-integer.js (renamed from test/disabled/outdated-depth-integer.js) | 49 |
4 files changed, 37 insertions, 24 deletions
diff --git a/test/disabled/outdated-depth-integer/README.md b/test/disabled/outdated-depth-integer/README.md deleted file mode 100644 index aca67ff17..000000000 --- a/test/disabled/outdated-depth-integer/README.md +++ /dev/null @@ -1 +0,0 @@ -# just a test diff --git a/test/disabled/outdated-depth-integer/index.js b/test/disabled/outdated-depth-integer/index.js deleted file mode 100644 index 33c1891f8..000000000 --- a/test/disabled/outdated-depth-integer/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = true diff --git a/test/disabled/outdated-depth-integer/package.json b/test/disabled/outdated-depth-integer/package.json deleted file mode 100644 index df269dc72..000000000 --- a/test/disabled/outdated-depth-integer/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "whatever", - "description": "yeah idk", - "version": "1.2.3", - "main": "index.js", - "dependencies": { - "underscore": "1.3.1" - }, - "repository": "git://github.com/luk-/whatever" -} diff --git a/test/disabled/outdated-depth-integer.js b/test/tap/outdated-depth-integer.js index 4cad5e693..485e84e30 100644 --- a/test/disabled/outdated-depth-integer.js +++ b/test/tap/outdated-depth-integer.js @@ -3,28 +3,53 @@ var common = require('../common-tap') , rimraf = require('rimraf') , npm = require('../../') , mr = require('npm-registry-mock') - , pkg = __dirname + '/outdated-depth' + , pkg = __dirname + '/outdated-depth-integer' + +var osenv = require("osenv") +var mkdirp = require("mkdirp") +var fs = require("fs") + +var pj = JSON.stringify({ + "name": "whatever", + "description": "yeah idk", + "version": "1.2.3", + "main": "index.js", + "dependencies": { + "underscore": "1.3.1" + }, + "repository": "git://github.com/luk-/whatever" +}, null, 2); function cleanup () { - rimraf.sync(pkg + '/node_modules') - rimraf.sync(pkg + '/cache') + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + mkdirp.sync(pkg) + process.chdir(pkg) + fs.writeFileSync("package.json", pj) } +test("setup", function (t) { + cleanup() + setup() + t.end() +}) + test('outdated depth integer', function (t) { // todo: update with test-package-with-one-dep once the new // npm-registry-mock is published - var expected = [ + var expected = [[ pkg, 'underscore', - '1.3.1', - '1.3.1', - '1.5.1', + undefined, // no version installed + '1.3.1', // wanted + '1.5.1', // latest '1.3.1' - ] - - process.chdir(pkg) + ]] - mr({port : common.port}, function (s) { + mr({port : common.port}, function (er, s) { npm.load({ cache: pkg + '/cache' , loglevel: 'silent' @@ -36,7 +61,7 @@ test('outdated depth integer', function (t) { if (er) throw new Error(er) npm.outdated(function (err, d) { if (err) throw new Error(err) - t.deepEqual(d[0], expected) + t.deepEqual(d, expected) s.close() t.end() }) |