From 590a0f6214dcc23087c8968b6bc9be5ba61836a9 Mon Sep 17 00:00:00 2001 From: Jah Raphael Date: Sun, 8 Jan 2017 09:22:24 -0600 Subject: [PATCH 1/2] Print the name of the actual missing dependency in `async.auto` --- lib/auto.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/auto.js b/lib/auto.js index 61868070a..eca7d5311 100644 --- a/lib/auto.js +++ b/lib/auto.js @@ -137,7 +137,8 @@ export default function (tasks, concurrency, callback) { arrayEach(dependencies, function (dependencyName) { if (!tasks[dependencyName]) { throw new Error('async.auto task `' + key + - '` has a non-existent dependency in ' + + '` has a non-existent dependency `' + + dependencyName + '` in ' + dependencies.join(', ')); } addListener(dependencyName, function () { From 4820ab88b9a6162ebcb456955c704bfb30af3827 Mon Sep 17 00:00:00 2001 From: Jah Raphael Date: Sun, 8 Jan 2017 19:50:34 -0600 Subject: [PATCH 2/2] enhance "inexistent dependencies" test to check that exception message contains the missing dependency name --- mocha_test/auto.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mocha_test/auto.js b/mocha_test/auto.js index 55f3b253f..e2e55f9f3 100644 --- a/mocha_test/auto.js +++ b/mocha_test/auto.js @@ -286,7 +286,7 @@ describe('auto', function () { callback(null, 'task1'); }] }); - }).to.throw(); + }).to.throw(/dependency `noexist`/); done(); });