From dbf77846fdfd5814148a868d8fb58a8b94ea3b96 Mon Sep 17 00:00:00 2001 From: Tim Caswell Date: Mon, 5 Apr 2010 15:08:56 -0500 Subject: [PATCH] Update the simpleCase example to the new API. --- test/test.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/test.js b/test/test.js index 89238ed..4fbcb45 100644 --- a/test/test.js +++ b/test/test.js @@ -70,21 +70,24 @@ processFileSync("I don't exist", outputHandler("processFileSync-ERROR")); var simpleCase = Conduct({ A: [function(callback) { process.nextTick(function () { - callback("a1", "a2"); + callback(undefined, "a1", "a2"); }); }], - B: ["A1", function (input, callback) { + B: ["A2", function (input, callback) { process.nextTick(function () { - callback(input + "modified"); + callback(undefined, input + "modified"); }); }], - C: ["A0","B0", function (input1, input2, callback) { - sys.p({ + C: ["A1","B1", function (input1, input2, callback) { + return { input1: input1, input2: input2 - }); + }; }] -}); +}, "C1"); + + +simpleCase(outputHandler("simpleCase")); // // Same example but without using Conductor. // // Note the level of error handling done automatically by Conductor.