summaryrefslogtreecommitdiff
path: root/deps/npm/test/tap/install-at-locally.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2014-02-16 20:43:16 -0800
committerisaacs <i@izs.me>2014-02-16 20:43:16 -0800
commitec2fc4ca4d3eacaa3dc1db1673169b89233b9823 (patch)
tree0aa8a647e5111653bdf9c122182be93bf8823c7b /deps/npm/test/tap/install-at-locally.js
parent86b8d84811484763b251b9a8a2b9e673964ea6b5 (diff)
downloadnode-npm-v1.4.3.tar.gz
npm: upgrade to 1.4.3npm-v1.4.3
Diffstat (limited to 'deps/npm/test/tap/install-at-locally.js')
-rw-r--r--deps/npm/test/tap/install-at-locally.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/deps/npm/test/tap/install-at-locally.js b/deps/npm/test/tap/install-at-locally.js
new file mode 100644
index 000000000..18ea6c3a6
--- /dev/null
+++ b/deps/npm/test/tap/install-at-locally.js
@@ -0,0 +1,43 @@
+var common = require('../common-tap.js')
+var test = require('tap').test
+var npm = require('../../')
+var osenv = require('osenv')
+var path = require('path')
+var fs = require('fs')
+var rimraf = require('rimraf')
+var mkdirp = require('mkdirp')
+var pkg = path.join(__dirname, 'install-at-locally')
+
+test("setup", function (t) {
+ mkdirp.sync(pkg)
+ mkdirp.sync(path.resolve(pkg, 'node_modules'))
+ process.chdir(pkg)
+ t.end()
+})
+
+test('"npm install ./package@1.2.3" should install local pkg', function(t) {
+ npm.load(function() {
+ npm.commands.install(['./package@1.2.3'], function(err) {
+ var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p, 'utf8')))
+ t.end()
+ })
+ })
+})
+
+test('"npm install install/at/locally@./package@1.2.3" should install local pkg', function(t) {
+ npm.load(function() {
+ npm.commands.install(['./package@1.2.3'], function(err) {
+ var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p, 'utf8')))
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function(t) {
+ process.chdir(__dirname)
+ rimraf.sync(path.resolve(pkg, 'node_modules'))
+ t.end()
+})
+