mirror of
https://github.com/nodejs/node.git
synced 2026-11-15 10:36:53 -05:00
Added failing test: promise.wait() after promise.emitXXX()
This commit is contained in:
1 parent
95fd370096
commit
80ace36e4c
1 file changed
+15
@@ -45,6 +45,9 @@ p5.addCallback(function () {
|
||||
}, 100);
|
||||
});
|
||||
|
||||
var p6 = new events.Promise();
|
||||
var p7 = new events.Promise();
|
||||
p7.addErrback(function() {});
|
||||
|
||||
p2.emitSuccess();
|
||||
|
||||
@@ -74,6 +77,18 @@ assert.deepEqual(["a","b","c"], ret4);
|
||||
|
||||
assert.equal(true, p4_done);
|
||||
|
||||
|
||||
p6.emitSuccess("something");
|
||||
assert.equal("something", p6.wait());
|
||||
p7.emitError("argh!");
|
||||
var goterr;
|
||||
try {
|
||||
p7.wait();
|
||||
} catch(err) {
|
||||
goterr = err;
|
||||
}
|
||||
assert.equal("argh!", goterr.toString());
|
||||
|
||||
process.addListener("exit", function () {
|
||||
assert.equal(true, p1_done);
|
||||
assert.equal(true, p2_done);
|
||||
|
||||
Reference in new issue
Block a user