aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2025-05-31 09:46:11 +0100
committerMichael Williamson <mike@zwobble.org>2026-09-16 23:38:21 +0100
commit64d0ed6e293f2a3a7ed2c3be97a805f02724693d (patch)
tree02e039795aa90d167dd2491c8a0b6459058a6d1a
parent92639e6a702c01a1019fdf1bc5fed377e352af0d (diff)
Test rejected value in props()
-rw-r--r--test/promises.tests.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/promises.tests.js b/test/promises.tests.js
index f54245b..05b27d0 100644
--- a/test/promises.tests.js
+++ b/test/promises.tests.js
@@ -82,6 +82,21 @@ test("props", {
});
},
+ "when value is rejected promise then props is rejected promise": function() {
+ return promises.props({
+ a: promises.resolve(1),
+ b: promises.reject(new Error("failure")),
+ c: promises.resolve(3)
+ }).then(
+ function(result) {
+ assert.fail("Expected rejection");
+ },
+ function(error) {
+ assert.strictEqual(error.message, "failure");
+ }
+ );
+ },
+
"props(...).also(...) can be used to add props": function() {
return promises.props({
a: promises.resolve(1)