diff options
Diffstat (limited to 'deps/npm/test/tap/install-actions.js')
-rw-r--r-- | deps/npm/test/tap/install-actions.js | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/deps/npm/test/tap/install-actions.js b/deps/npm/test/tap/install-actions.js index c71b0044e1d..ad75cacb5ed 100644 --- a/deps/npm/test/tap/install-actions.js +++ b/deps/npm/test/tap/install-actions.js @@ -20,7 +20,7 @@ test('setup', function (t) { test('->optdep:a->dep:b', function (t) { var moduleA = { name: 'a', - path: '/', + path: '/a', package: { scripts: { postinstall: 'false' @@ -28,11 +28,12 @@ test('->optdep:a->dep:b', function (t) { dependencies: { b: '*' } - } + }, + isTop: true } var moduleB = { name: 'b', - path: '/', + path: '/b', package: {}, requires: [], requiredBy: [moduleA] @@ -47,13 +48,16 @@ test('->optdep:a->dep:b', function (t) { } }, children: [moduleA, moduleB], - requires: [moduleA] + requires: [moduleA], + isTop: true } moduleA.requiredBy = [tree] + moduleA.parent = tree + moduleB.parent = tree t.plan(3) actions.postinstall('/', '/', moduleA, mockLog, function (er) { - t.ok(er && er.code === 'ELIFECYCLE', 'Lifecycle failed') + t.is(er && er.code, 'ELIFECYCLE', 'Lifecycle failed') t.ok(moduleA.failed, 'moduleA (optional dep) is marked failed') t.ok(moduleB.failed, 'moduleB (direct dep of moduleA) is marked as failed') t.end() @@ -71,14 +75,16 @@ test('->dep:b,->optdep:a->dep:b', function (t) { dependencies: { b: '*' } - } + }, + isTop: false } var moduleB = { name: 'b', path: '/', package: {}, requires: [], - requiredBy: [moduleA] + requiredBy: [moduleA], + isTop: false } moduleA.requires = [moduleB] @@ -93,10 +99,13 @@ test('->dep:b,->optdep:a->dep:b', function (t) { } }, children: [moduleA, moduleB], - requires: [moduleA, moduleB] + requires: [moduleA, moduleB], + isTop: true } moduleA.requiredBy = [tree] moduleB.requiredBy.push(tree) + moduleA.parent = tree + moduleB.parent = tree t.plan(3) actions.postinstall('/', '/', moduleA, mockLog, function (er) { |