Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zimbatm/285470 to your computer and use it in GitHub Desktop.
Save zimbatm/285470 to your computer and use it in GitHub Desktop.
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