summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Promise/any/reject-all-mixed.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Promise/any/reject-all-mixed.js')
-rw-r--r--js/src/tests/test262/built-ins/Promise/any/reject-all-mixed.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Promise/any/reject-all-mixed.js b/js/src/tests/test262/built-ins/Promise/any/reject-all-mixed.js
new file mode 100644
index 0000000000..0a4da17aa3
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Promise/any/reject-all-mixed.js
@@ -0,0 +1,27 @@
+// |reftest| async
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-promise.any
+description: >
+ Promise.any rejection reasons from various rejections are all present
+flags: [async]
+features: [Promise.any, arrow-function]
+---*/
+
+let rejections = [
+ Promise.reject('a'),
+ new Promise((_, reject) => reject('b')),
+ Promise.all([Promise.reject('c')]),
+ Promise.resolve(Promise.reject('d')),
+];
+
+Promise.any(rejections)
+ .then(
+ () => $DONE('The promise should be rejected, but was resolved'),
+ error => {
+ assert.sameValue(error.errors.length, rejections.length);
+ assert.sameValue(error.errors.join(''), 'abcd');
+ }
+ ).then($DONE, $DONE);