Created
January 24, 2010 21:45
-
-
Save zimbatm/285470 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 5a534273b25a97f15305d3e0d562a6016c545615 Mon Sep 17 00:00:00 2001 | |
From: Jonas Pfenniger <jonas@pfenniger.name> | |
Date: Sun, 24 Jan 2010 22:43:46 +0100 | |
Subject: [PATCH] [test] More promise late binding tests | |
--- | |
test/mjsunit/test-promise.js | 6 ++++++ | |
1 files changed, 6 insertions(+), 0 deletions(-) | |
diff --git a/test/mjsunit/test-promise.js b/test/mjsunit/test-promise.js | |
index 9b314ea..2992f93 100644 | |
--- a/test/mjsunit/test-promise.js | |
+++ b/test/mjsunit/test-promise.js | |
@@ -19,12 +19,18 @@ a.addCallback(function(value) { | |
assert.equal(TEST_VALUE, value); | |
expectedCallbacks.a1--; | |
}); | |
+a.addErrback(function(error) { | |
+ assert.notEqual(TEST_VALUE, error, 'normal'); | |
+}); | |
a.emitSuccess(TEST_VALUE); | |
a.addCallback(function(value) { | |
assert.equal(TEST_VALUE, value); | |
expectedCallbacks.a2--; | |
}); | |
+a.addErrback(function(error) { | |
+ assert.notEqual(TEST_VALUE, error, 'late'); | |
+}); | |
// Test regular & late errback binding | |
var b = new Promise(); | |
-- | |
1.6.6.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment