@@ -5,12 +5,16 @@ describe('RatInAMaze', () => {
55 const values = [ undefined , null , { } , 42 , 'hello, world' ]
66
77 for ( const value of values ) {
8- expect ( ( ) => { new RatInAMaze ( value ) } ) . toThrow ( )
8+ // we deliberately want to check whether this constructor call fails or not
9+ // eslint-disable-next-line no-new
10+ expect ( ( ) => { new RatInAMaze ( value ) } ) . toThrow ( )
911 }
1012 } )
1113
1214 it ( 'should fail for an empty array' , ( ) => {
13- expect ( ( ) => { new RatInAMaze ( [ ] ) } ) . toThrow ( )
15+ // we deliberately want to check whether this constructor call fails or not
16+ // eslint-disable-next-line no-new
17+ expect ( ( ) => { new RatInAMaze ( [ ] ) } ) . toThrow ( )
1418 } )
1519
1620 it ( 'should fail for a non-square array' , ( ) => {
@@ -19,14 +23,18 @@ describe('RatInAMaze', () => {
1923 [ 0 , 0 ]
2024 ]
2125
22- expect ( ( ) => { new RatInAMaze ( array ) } ) . toThrow ( )
26+ // we deliberately want to check whether this constructor call fails or not
27+ // eslint-disable-next-line no-new
28+ expect ( ( ) => { new RatInAMaze ( array ) } ) . toThrow ( )
2329 } )
2430
2531 it ( 'should fail for arrays containing invalid values' , ( ) => {
2632 const values = [ [ [ 2 ] ] , [ [ 'a' ] ] ]
2733
2834 for ( const value of values ) {
29- expect ( ( ) => { new RatInAMaze ( value ) } ) . toThrow ( )
35+ // we deliberately want to check whether this constructor call fails or not
36+ // eslint-disable-next-line no-new
37+ expect ( ( ) => { new RatInAMaze ( value ) } ) . toThrow ( )
3038 }
3139 } )
3240
0 commit comments