diff --git a/Q/Q-tests.ts b/Q/Q-tests.ts index 8724ed5a6..34cde9341 100644 --- a/Q/Q-tests.ts +++ b/Q/Q-tests.ts @@ -47,3 +47,10 @@ Q.allResolved([]) } }) }); + +var initialVal: any; +var funcs = ['foo', 'bar', 'baz', 'qux']; +var result = Q.resolve(initialVal); +funcs.forEach(function (f) { + result = result.then(f); +}); \ No newline at end of file diff --git a/Q/q.module-tests.ts b/Q/q.module-tests.ts index 02116c2e8..e90d17c2e 100644 --- a/Q/q.module-tests.ts +++ b/Q/q.module-tests.ts @@ -72,4 +72,11 @@ Q.allResolved([]) var exception = promise.valueOf().exception; } }) +}); + +var initialVal: any; +var funcs = ['foo', 'bar', 'baz', 'qux']; +var result = Q.resolve(initialVal); +funcs.forEach(function (f) { + result = result.then(f); }); \ No newline at end of file diff --git a/Q/q.module.d.ts b/Q/q.module.d.ts index 9850e7276..3c88ec737 100644 --- a/Q/q.module.d.ts +++ b/Q/q.module.d.ts @@ -24,4 +24,5 @@ module "q" { export function nextTick(callback: Function); export var oneerror: any; export var longStackJumpLimit: number; + export function resolve(object?:Qpromise); } \ No newline at end of file