@@ -134,7 +134,7 @@ describe('CookieJar', () => {
134134 cookieJar . setCookie ( '=b' , 'http://example.com/index.html' , {
135135 loose : false ,
136136 } ) ,
137- ) . rejects . toThrowError ( 'Cookie failed to parse' )
137+ ) . rejects . toThrow ( 'Cookie failed to parse' )
138138 } )
139139
140140 it ( 'should not default to loose: true when using map' , ( ) => {
@@ -254,7 +254,7 @@ describe('CookieJar', () => {
254254 'a=b; Domain=fooxample.com; Path=/' ,
255255 'http://example.com/index.html' ,
256256 ) ,
257- ) . rejects . toThrowError (
257+ ) . rejects . toThrow (
258258 "Cookie not in this host's domain. Cookie:fooxample.com Request:example.com" ,
259259 )
260260 } )
@@ -266,7 +266,7 @@ describe('CookieJar', () => {
266266 'a=b; Domain=www.example.com; Path=/' ,
267267 'http://example.com/index.html' ,
268268 ) ,
269- ) . rejects . toThrowError (
269+ ) . rejects . toThrow (
270270 "Cookie not in this host's domain. Cookie:www.example.com Request:example.com" ,
271271 )
272272 } )
@@ -301,7 +301,7 @@ describe('CookieJar', () => {
301301 'http://example.com/index.html' ,
302302 { http : false } ,
303303 ) ,
304- ) . rejects . toThrowError ( "Cookie is HttpOnly and this isn't an HTTP API" )
304+ ) . rejects . toThrow ( "Cookie is HttpOnly and this isn't an HTTP API" )
305305 } )
306306
307307 it ( 'should not fail when using an httpOnly cookie when using a non-HTTP API' , async ( ) => {
@@ -1069,7 +1069,7 @@ describe('setCookie errors', () => {
10691069 const cookieJar = new CookieJar ( )
10701070 await expect (
10711071 cookieJar . setCookie ( 'i=9; Domain=kyoto.jp; Path=/' , 'http://kyoto.jp' ) ,
1072- ) . rejects . toThrowError ( 'Cookie has domain set to a public suffix' )
1072+ ) . rejects . toThrow ( 'Cookie has domain set to a public suffix' )
10731073 } )
10741074
10751075 it ( 'should throw an error if domains do not match' , async ( ) => {
@@ -1079,7 +1079,7 @@ describe('setCookie errors', () => {
10791079 'j=10; Domain=google.com; Path=/' ,
10801080 'http://google.ca' ,
10811081 ) ,
1082- ) . rejects . toThrowError (
1082+ ) . rejects . toThrow (
10831083 `Cookie not in this host's domain. Cookie:google.com Request:google.ca` ,
10841084 )
10851085 } )
@@ -1097,7 +1097,7 @@ describe('setCookie errors', () => {
10971097 'http://example.ca' ,
10981098 { http : false } ,
10991099 ) ,
1100- ) . rejects . toThrowError ( "old Cookie is HttpOnly and this isn't an HTTP API" )
1100+ ) . rejects . toThrow ( "old Cookie is HttpOnly and this isn't an HTTP API" )
11011101
11021102 const cookies = await cookieJar . getCookies ( 'http://example.ca' , {
11031103 http : true ,
@@ -1149,7 +1149,7 @@ it('should fix issue #132', async () => {
11491149 await expect (
11501150 // @ts -expect-error test case is explicitly testing invalid input
11511151 cookieJar . setCookie ( { key : 'x' , value : 'y' } , 'http://example.com/' ) ,
1152- ) . rejects . toThrowError (
1152+ ) . rejects . toThrow (
11531153 'First argument to setCookie must be a Cookie object or string' ,
11541154 )
11551155} )
@@ -1186,9 +1186,9 @@ it('should fix issue #145 - missing 2nd url parameter', async () => {
11861186
11871187it ( 'should fix issue #197 - CookieJar().setCookie throws an error when empty cookie is passed' , async ( ) => {
11881188 const cookieJar = new CookieJar ( )
1189- await expect (
1190- cookieJar . setCookie ( '' , 'https://google.com' ) ,
1191- ) . rejects . toThrowError ( 'Cookie failed to parse' )
1189+ await expect ( cookieJar . setCookie ( '' , 'https://google.com' ) ) . rejects . toThrow (
1190+ 'Cookie failed to parse' ,
1191+ )
11921192} )
11931193
11941194it ( 'should fix issue #282 - Prototype pollution when setting a cookie with the domain __proto__' , ( ) => {
0 commit comments