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>2017-03-15 00:39:54 +0300
committerRebecca Turner <me@re-becca.org>2017-03-16 03:54:06 +0300
commit1af85ca9f4d625f948e85961372de7df3f3774e2 (patch)
treef85ff8527bb48d0a63bc00d880344f217739b3db /test
parent2c2737d4186a0fd304e3e808bb9bd005d34f7fce (diff)
pack: Bundle dependencies inside bundled scope deps
Credit: @iarna PR-URL: https://github.com/npm/npm/pull/16040 Reviewed-By: @zkat
Diffstat (limited to 'test')
-rw-r--r--test/tap/bundled-transitive-deps.js32
1 files changed, 27 insertions, 5 deletions
diff --git a/test/tap/bundled-transitive-deps.js b/test/tap/bundled-transitive-deps.js
index 4aefe5b9c..9af12337d 100644
--- a/test/tap/bundled-transitive-deps.js
+++ b/test/tap/bundled-transitive-deps.js
@@ -18,10 +18,12 @@ var fixture = new Tacks(
name: 'bundled-transitive-deps',
version: '1.0.0',
dependencies: {
- 'a': '1.0.0'
+ 'a': '1.0.0',
+ '@c/d': '1.0.0'
},
bundleDependencies: [
- 'a'
+ 'a',
+ '@c/d'
]
}),
node_modules: Dir({
@@ -39,6 +41,20 @@ var fixture = new Tacks(
name: 'b',
version: '1.0.0'
})
+ }),
+ '@c/d': Dir({
+ 'package.json': File({
+ name: '@c/d',
+ version: '1.0.0'
+ }),
+ 'node_modules': Dir({
+ 'e': Dir({
+ 'package.json': File({
+ name: 'e',
+ version: '1.0.0'
+ })
+ })
+ })
})
})
})
@@ -58,6 +74,12 @@ test('setup', function (t) {
npm.load({}, t.end)
})
+function exists (t, filename) {
+ t.doesNotThrow(filename + ' exists', function () {
+ fs.statSync(filename)
+ })
+}
+
test('bundled-transitive-deps', function (t) {
common.npm(['pack'], {cwd: testdir}, thenCheckPack)
function thenCheckPack (err, code, stdout, stderr) {
@@ -70,9 +92,9 @@ test('bundled-transitive-deps', function (t) {
function thenCheckContents (err) {
t.ifError(err, 'unpack successful')
var transitivePackedDep = path.join(packed, 'node_modules', 'b')
- t.doesNotThrow(transitivePackedDep + ' exists', function () {
- fs.statSync(transitivePackedDep)
- })
+ exists(t, transitivePackedDep)
+ var nestedScopedDep = path.join(packed, 'node_modules', '@c', 'd', 'node_modules', 'e')
+ exists(t, nestedScopedDep)
t.end()
}
})