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:
authorKat Marchán <kzm@sykosomatic.org>2017-05-12 12:33:31 +0300
committerRebecca Turner <me@re-becca.org>2017-05-26 04:55:19 +0300
commitd27c18195478462d7e5dcdbdba220e790e07af12 (patch)
treeb1346c0cd092cc96e5a3876f51037876f241d97e /test
parentdaa77708adeb4fed5067472732deeee05b7930cd (diff)
actions: converted actions.js to use mainly promises
Diffstat (limited to 'test')
-rw-r--r--test/tap/install-actions.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/tap/install-actions.js b/test/tap/install-actions.js
index 824a31c1b..6ca6e3353 100644
--- a/test/tap/install-actions.js
+++ b/test/tap/install-actions.js
@@ -56,8 +56,10 @@ test('->optdep:a->dep:b', function (t) {
moduleB.parent = tree
t.plan(3)
- actions.postinstall('/', moduleA, mockLog, function (er) {
- t.is(er && er.code, 'ELIFECYCLE', 'Lifecycle failed')
+ return actions.postinstall('/', moduleA, mockLog).then(() => {
+ throw new Error('was not supposed to succeed')
+ }, (err) => {
+ t.is(err && err.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()
@@ -108,8 +110,10 @@ test('->dep:b,->optdep:a->dep:b', function (t) {
moduleB.parent = tree
t.plan(3)
- actions.postinstall('/', moduleA, mockLog, function (er) {
- t.ok(er && er.code === 'ELIFECYCLE', 'Lifecycle failed')
+ return actions.postinstall('/', moduleA, mockLog).then(() => {
+ throw new Error('was not supposed to succeed')
+ }, (err) => {
+ t.ok(err && err.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()