@@ -5,12 +5,16 @@ describe('RatInAMaze', () => {
5
5
const values = [ undefined , null , { } , 42 , 'hello, world' ]
6
6
7
7
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 ( )
9
11
}
10
12
} )
11
13
12
14
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 ( )
14
18
} )
15
19
16
20
it ( 'should fail for a non-square array' , ( ) => {
@@ -19,14 +23,18 @@ describe('RatInAMaze', () => {
19
23
[ 0 , 0 ]
20
24
]
21
25
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 ( )
23
29
} )
24
30
25
31
it ( 'should fail for arrays containing invalid values' , ( ) => {
26
32
const values = [ [ [ 2 ] ] , [ [ 'a' ] ] ]
27
33
28
34
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 ( )
30
38
}
31
39
} )
32
40
0 commit comments