From f0faf9b117f8c3ada2f9b81c261be527ff060d1d Mon Sep 17 00:00:00 2001 From: Brian Cavalier Date: Sun, 11 Mar 2012 19:36:47 -0400 Subject: [PATCH] Another unit test to cover the specific case in #23 --- test/promise.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/promise.js b/test/promise.js index 42b29a4f..af86a7fb 100644 --- a/test/promise.js +++ b/test/promise.js @@ -66,6 +66,28 @@ buster.testCase('promise', { }, + 'should forward result when callback is null': function(done) { + var d = when.defer(); + + function fail(e) { + buster.fail(e); + done(); + } + + d.promise.then( + null, + fail + ).then( + function(val) { + assert.equals(val, 1); + done(); + }, + fail + ); + + d.resolve(1); + }, + 'should forward callback result to next callback': function(done) { var d = when.defer();