From 844c913df0b862b23697afd93c89e58d351dd924 Mon Sep 17 00:00:00 2001 From: ersimont Date: Wed, 16 Nov 2016 22:31:40 -0500 Subject: [PATCH 1/2] Add animate.IAnimateService --- angular-mocks/index.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/angular-mocks/index.d.ts b/angular-mocks/index.d.ts index 3c24ed1cf6..b14cf70a3b 100644 --- a/angular-mocks/index.d.ts +++ b/angular-mocks/index.d.ts @@ -301,6 +301,25 @@ declare module 'angular' { whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean), keys?: Object[]): mock.IRequestHandler; } + /////////////////////////////////////////////////////////////////////////// + // AnimateService + // see https://docs.angularjs.org/api/ngMock/service/$animate + /////////////////////////////////////////////////////////////////////////// + module animate { + interface IAnimateService { + + /** + * This method will close all pending animations (both Javascript and CSS) and it will also flush any remaining animation frames and/or callbacks. + */ + closeAndFlush(); + + /** + * This method is used to flush the pending callbacks and animation frames to either start an animation or conclude an animation. Note that this will not actually close an actively running animation (see `closeAndFlush()` for that). + */ + flush(): void; + } + } + export module mock { // returned interface by the the mocked HttpBackendService expect/when methods interface IRequestHandler { From 6d1d3060813f59e23c816d8f96c08d8f5d97b264 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 23 Nov 2016 11:12:28 -0800 Subject: [PATCH 2/2] Make `IAnimateService.closeAndFlush` return void --- angular-mocks/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-mocks/index.d.ts b/angular-mocks/index.d.ts index b14cf70a3b..8aa172e293 100644 --- a/angular-mocks/index.d.ts +++ b/angular-mocks/index.d.ts @@ -311,7 +311,7 @@ declare module 'angular' { /** * This method will close all pending animations (both Javascript and CSS) and it will also flush any remaining animation frames and/or callbacks. */ - closeAndFlush(); + closeAndFlush(): void; /** * This method is used to flush the pending callbacks and animation frames to either start an animation or conclude an animation. Note that this will not actually close an actively running animation (see `closeAndFlush()` for that).