2014-10-23 19:58:31 +02:00
|
|
|
// Copyright 2014 Cubane Canada, Inc. All rights reserved.
|
|
|
|
// See LICENSE for details.
|
|
|
|
|
|
|
|
/*---
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2014-10-23 19:58:31 +02:00
|
|
|
Promise.all with 1-element array
|
|
|
|
should accept an array with settled promise
|
2015-02-10 22:01:39 +01:00
|
|
|
es6id: S25.4.4.1_A6.1_T2
|
2014-10-23 19:58:31 +02:00
|
|
|
author: Sam Mikes
|
|
|
|
description: Promise.all([p1]) is resolved with a promise for a one-element array
|
2016-02-12 18:59:51 +01:00
|
|
|
flags: [async]
|
2014-10-23 19:58:31 +02:00
|
|
|
---*/
|
|
|
|
|
|
|
|
var p1 = Promise.resolve(3);
|
|
|
|
|
|
|
|
var pAll = Promise.all([p1]);
|
|
|
|
|
2018-02-15 21:11:21 +01:00
|
|
|
pAll.then(function(result) {
|
2021-08-18 17:44:54 +02:00
|
|
|
assert(!!(pAll instanceof Promise), 'The value of !!(pAll instanceof Promise) is expected to be true');
|
|
|
|
assert(!!(result instanceof Array), 'The value of !!(result instanceof Array) is expected to be true');
|
|
|
|
assert.sameValue(result.length, 1, 'The value of result.length is expected to be 1');
|
|
|
|
assert.sameValue(result[0], 3, 'The value of result[0] is expected to be 3');
|
2014-10-23 19:58:31 +02:00
|
|
|
}).then($DONE, $DONE);
|