mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +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:
@@ -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