summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/nopt/test/basic.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/nopt/test/basic.js')
-rw-r--r--deps/npm/node_modules/nopt/test/basic.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/deps/npm/node_modules/nopt/test/basic.js b/deps/npm/node_modules/nopt/test/basic.js
index 1a67894631..b31dccf54b 100644
--- a/deps/npm/node_modules/nopt/test/basic.js
+++ b/deps/npm/node_modules/nopt/test/basic.js
@@ -15,6 +15,14 @@ test("Empty String results in empty string, not true", function (t) {
t.end()
})
+test("~ path is resolved to $HOME", function (t) {
+ var path = require("path")
+ if (!process.env.HOME) process.env.HOME = "/tmp"
+ var parsed = nopt({key: path}, {}, ["--key=~/val"], 0)
+ t.same(parsed.key, path.resolve(process.env.HOME, "val"))
+ t.end()
+})
+
test("other tests", function (t) {
var util = require("util")