diff options
author | isaacs <i@izs.me> | 2014-02-17 05:49:56 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-02-17 05:50:49 +0400 |
commit | 9dfcc314b2651ce609ffbcafbb710014f125a6f3 (patch) | |
tree | 43c00157a6960253886a1fb58c54a6a9d21c5364 /test | |
parent | 9575a23f955ce3e75b509c89504ef0bd707c8cf6 (diff) |
test: Add test for outdated --parseable
Diffstat (limited to 'test')
-rw-r--r-- | test/tap/outdated.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/test/tap/outdated.js b/test/tap/outdated.js index 3a9951b3c..dddec77ea 100644 --- a/test/tap/outdated.js +++ b/test/tap/outdated.js @@ -8,19 +8,41 @@ var mr = require("npm-registry-mock") // config var pkg = __dirname + '/outdated' +var path = require("path") + test("it should not throw", function (t) { cleanup() process.chdir(pkg) + var originalLog = console.log + var output = [] + var expOut = [ path.resolve(__dirname, "outdated/node_modules/underscore") + , path.resolve(__dirname, "outdated/node_modules/underscore") + + ":underscore@1.3.1" + + ":underscore@1.3.1" + + ":underscore@1.5.1" ] + var expData = [ [ path.resolve(__dirname, "outdated") + , "underscore" + , "1.3.1" + , "1.3.1" + , "1.5.1" + , "1.3.1" ] ] + + console.log = function () { + output.push.apply(output, arguments) + } mr(common.port, function (s) { npm.load({ cache: pkg + "/cache", loglevel: 'silent', + parseable: true, registry: common.registry } , function () { npm.install(".", function (err) { npm.outdated(function (er, d) { - console.log(d) + console.log = originalLog + t.same(output, expOut) + t.same(d, expData) s.close() t.end() }) |