Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2015-10-07 01:55:52 +0300
committerRebecca Turner <me@re-becca.org>2015-10-09 02:24:34 +0300
commit4a974404f2172750bf594dc0007b5fe78854cb89 (patch)
treec4877f5db4ce5f6f0a216397796d86e2d995d0d5 /test
parent5a6e8730689579a11a6770db53721a817f30cf0e (diff)
child-path: Compute the path of a new child module in only one place
PR-URL: //github.com/npm/npm/pull/9890 Fixes: #9766
Diffstat (limited to 'test')
-rw-r--r--test/tap/unit-child-path.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/tap/unit-child-path.js b/test/tap/unit-child-path.js
new file mode 100644
index 000000000..5e9b452a3
--- /dev/null
+++ b/test/tap/unit-child-path.js
@@ -0,0 +1,9 @@
+'use strict'
+var test = require('tap').test
+var childPath = require('../../lib/utils/child-path.js')
+
+test('childPath', function (t) {
+ t.is(childPath('/path/to', {name: 'abc'}), '/path/to/node_modules/abc', 'basic use')
+ t.is(childPath('/path/to', {package: {name: '@zed/abc'}}), '/path/to/node_modules/@zed/abc', 'scoped use')
+ t.end()
+})