@@ -37,6 +37,10 @@ class FakeQueryList<T> extends QueryList<T> {
3737 notifyOnChanges ( ) { this . changes . next ( this ) ; }
3838}
3939
40+ interface KeyEventTestContext {
41+ nextKeyEvent : KeyboardEvent ;
42+ prevKeyEvent : KeyboardEvent ;
43+ }
4044
4145describe ( 'Key managers' , ( ) => {
4246 let itemList : FakeQueryList < any > ;
@@ -164,7 +168,7 @@ describe('Key managers', () => {
164168 expect ( fakeKeyEvents . downArrow . defaultPrevented ) . toBe ( false ) ;
165169 } ) ;
166170
167- describe ( 'with `vertical` direction' , ( ) => {
171+ describe ( 'with `vertical` direction' , function ( this : KeyEventTestContext ) {
168172 beforeEach ( ( ) => {
169173 keyManager . withVerticalOrientation ( ) ;
170174 this . nextKeyEvent = createKeyboardEvent ( 'keydown' , DOWN_ARROW ) ;
@@ -174,7 +178,7 @@ describe('Key managers', () => {
174178 runDirectionalKeyTests . call ( this ) ;
175179 } ) ;
176180
177- describe ( 'with `ltr` direction' , ( ) => {
181+ describe ( 'with `ltr` direction' , function ( this : KeyEventTestContext ) {
178182 beforeEach ( ( ) => {
179183 keyManager . withHorizontalOrientation ( 'ltr' ) ;
180184 this . nextKeyEvent = createKeyboardEvent ( 'keydown' , RIGHT_ARROW ) ;
@@ -184,7 +188,7 @@ describe('Key managers', () => {
184188 runDirectionalKeyTests . call ( this ) ;
185189 } ) ;
186190
187- describe ( 'with `rtl` direction' , ( ) => {
191+ describe ( 'with `rtl` direction' , function ( this : KeyEventTestContext ) {
188192 beforeEach ( ( ) => {
189193 keyManager . withHorizontalOrientation ( 'rtl' ) ;
190194 this . nextKeyEvent = createKeyboardEvent ( 'keydown' , LEFT_ARROW ) ;
@@ -199,7 +203,7 @@ describe('Key managers', () => {
199203 * parameters have to be passed in via Jasmine's context object (`this` inside a `beforeEach`)
200204 * because this function has to run before any `beforeEach`, `beforeAll` etc. hooks.
201205 */
202- function runDirectionalKeyTests ( ) {
206+ function runDirectionalKeyTests ( this : KeyEventTestContext ) {
203207 it ( 'should set subsequent items as active when the next key is pressed' , ( ) => {
204208 keyManager . onKeydown ( this . nextKeyEvent ) ;
205209
0 commit comments