mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-05 12:20:07 +08:00
Update Q tests to include fact deferred can be resolved with a value or promise
As per the Q docs "Note that a deferred can be resolved with a value or a promise. "
This commit is contained in:
1 parent
a44529fcb1
commit
a3a365d929
1 file changed
+4
@@ -16,6 +16,10 @@ Q.when(delay(1000), function (val: void) {
|
||||
return;
|
||||
});
|
||||
|
||||
// Note from Q documentation: a deferred can be resolved with a value or a promise.
|
||||
var otherPromise = Q.defer<string>().promise;
|
||||
Q.defer<string>().resolve(otherPromise);
|
||||
|
||||
Q.timeout(Q(new Date()), 1000, "My dates never arrived. :(").then(d => d.toJSON());
|
||||
|
||||
Q.delay(Q(8), 1000).then(x => x.toExponential());
|
||||
|
||||
Reference in new issue
Block a user