@@ -33,8 +33,8 @@ test('accessing an absent field should throw an error', async (t) => {
3333
3434 t . throws (
3535 ( ) => {
36- // @ts -ignore
37- stub . count
36+ // @ts -expect-error intended
37+ t . is ( stub . count , undefined )
3838 } ,
3939 {
4040 message : "Property 'stub.count' does not exist" ,
@@ -52,8 +52,8 @@ test('accessing a nested absent field should throw an error', async (t) => {
5252
5353 t . throws (
5454 ( ) => {
55- // @ts -ignore
56- stub . nested . name
55+ // @ts -expect-error intended
56+ t . is ( stub . nested . name , undefined )
5757 } ,
5858 {
5959 message : "Property 'stub.nested.name' does not exist" ,
@@ -67,9 +67,9 @@ test('fields used by jest are allowed to be undefined', async (t) => {
6767 count : 5 ,
6868 } )
6969
70- // @ts -ignore
70+ // @ts -expect-error intended
7171 t . is ( stub . nodeType , undefined )
72- // @ts -ignore
72+ // @ts -expect-error intended
7373 t . is ( stub . tagName , undefined )
7474} )
7575
@@ -79,7 +79,7 @@ test('Symbol props are allowed to be undefined', async (t) => {
7979 count : 5 ,
8080 } )
8181
82- // @ts -ignore
82+ // @ts -expect-error intended
8383 t . is ( stub [ Symbol ( 'my symbol' ) ] , undefined )
8484} )
8585
@@ -93,8 +93,8 @@ test('allowedUndefinedStubProps can be extended and restored', async (t) => {
9393
9494 t . throws (
9595 ( ) => {
96- // @ts -ignore
97- stub [ customProp ]
96+ // @ts -expect-error intended
97+ t . is ( stub [ customProp ] , undefined )
9898 } ,
9999 {
100100 message : "Property 'stub.myCustomProp' does not exist" ,
@@ -103,15 +103,15 @@ test('allowedUndefinedStubProps can be extended and restored', async (t) => {
103103
104104 allowedUndefinedStubProps . push ( 'myCustomProp' )
105105
106- // @ts -ignore
106+ // @ts -expect-error intended
107107 t . is ( stub [ customProp ] , undefined )
108108
109109 allowedUndefinedStubProps . pop ( )
110110
111111 t . throws (
112112 ( ) => {
113- // @ts -ignore
114- stub [ customProp ]
113+ // @ts -expect-error intended
114+ t . is ( stub [ customProp ] , undefined )
115115 } ,
116116 {
117117 message : "Property 'stub.myCustomProp' does not exist" ,
0 commit comments