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

let stages = [];

var isLoading = true;
var promise = new Promise((a, b) => {a()} );

promise.then(function(response) {
    throw new TypeError('oops');
})
.then(function(json) { })
.catch(e => stages.push(e))
.finally(() => stages.push('Done'))
.then(() => {
    assert.sameValue(stages[0] instanceof TypeError, true);
    assert.sameValue(stages[1], 'Done');
})
.then($DONE, $DONE);