aboutsummaryrefslogtreecommitdiff
path: root/test/js/promise_s03.t.js
blob: 9492dd6586a1336d70acc67daea141b083082e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*---
includes: [compareArray.js]
flags: [async]
---*/

let stages = [];

var promise = new Promise(function(resolve, reject) {
    stages.push('One');
    reject(42);
});

stages.push('Two');

promise.then(
    v => $DONOTEVALUATE(),
    v => assert.sameValue(v, 42))
.then(() => assert.compareArray(stages, ['One', 'Two', 'Three']))
.then($DONE, $DONE);

stages.push('Three');