@@ -154,7 +154,7 @@ describe("middlewares/auth", () => {
154154 { headers : { authorization : "ApeKey aWQua2V5" } } ,
155155 { acceptApeKeys : false } ,
156156 ) ,
157- ) . rejects . toThrowError ( "This endpoint does not accept ApeKeys" ) ;
157+ ) . rejects . toThrow ( "This endpoint does not accept ApeKeys" ) ;
158158
159159 //THEN
160160 } ) ;
@@ -170,7 +170,7 @@ describe("middlewares/auth", () => {
170170 { headers : { authorization : "ApeKey aWQua2V5" } } ,
171171 { acceptApeKeys : false } ,
172172 ) ,
173- ) . rejects . toThrowError ( "ApeKeys are not being accepted at this time" ) ;
173+ ) . rejects . toThrow ( "ApeKeys are not being accepted at this time" ) ;
174174
175175 //THEN
176176 } ) ;
@@ -253,7 +253,7 @@ describe("middlewares/auth", () => {
253253 ) ;
254254 } ) ;
255255 it ( "should fail without authentication" , async ( ) => {
256- await expect ( ( ) => authenticate ( { headers : { } } ) ) . rejects . toThrowError (
256+ await expect ( ( ) => authenticate ( { headers : { } } ) ) . rejects . toThrow (
257257 "Unauthorized\nStack: endpoint: /api/v1 no authorization header found" ,
258258 ) ;
259259
@@ -269,7 +269,7 @@ describe("middlewares/auth", () => {
269269 it ( "should fail with empty authentication" , async ( ) => {
270270 await expect ( ( ) =>
271271 authenticate ( { headers : { authorization : "" } } ) ,
272- ) . rejects . toThrowError (
272+ ) . rejects . toThrow (
273273 "Unauthorized\nStack: endpoint: /api/v1 no authorization header found" ,
274274 ) ;
275275
@@ -285,7 +285,7 @@ describe("middlewares/auth", () => {
285285 it ( "should fail with missing authentication token" , async ( ) => {
286286 await expect ( ( ) =>
287287 authenticate ( { headers : { authorization : "Bearer" } } ) ,
288- ) . rejects . toThrowError (
288+ ) . rejects . toThrow (
289289 "Missing authentication token\nStack: authenticateWithAuthHeader" ,
290290 ) ;
291291
@@ -301,7 +301,7 @@ describe("middlewares/auth", () => {
301301 it ( "should fail with unknown authentication scheme" , async ( ) => {
302302 await expect ( ( ) =>
303303 authenticate ( { headers : { authorization : "unknown format" } } ) ,
304- ) . rejects . toThrowError (
304+ ) . rejects . toThrow (
305305 'Unknown authentication scheme\nStack: The authentication scheme "unknown" is not implemented' ,
306306 ) ;
307307
@@ -417,7 +417,7 @@ describe("middlewares/auth", () => {
417417 //THEN
418418 await expect ( ( ) =>
419419 authenticate ( { headers : { } } , { isPublicOnDev : true } ) ,
420- ) . rejects . toThrowError ( "Unauthorized" ) ;
420+ ) . rejects . toThrow ( "Unauthorized" ) ;
421421 } ) ;
422422 it ( "should allow with apeKey on dev public endpoint in production" , async ( ) => {
423423 //WHEN
@@ -476,7 +476,7 @@ describe("middlewares/auth", () => {
476476 } ,
477477 { isGithubWebhook : true } ,
478478 ) ,
479- ) . rejects . toThrowError ( "Github webhook signature invalid" ) ;
479+ ) . rejects . toThrow ( "Github webhook signature invalid" ) ;
480480
481481 //THEH
482482 expect ( prometheusIncrementAuthMock ) . not . toHaveBeenCalled ( ) ;
@@ -497,7 +497,7 @@ describe("middlewares/auth", () => {
497497 } ,
498498 { isGithubWebhook : true } ,
499499 ) ,
500- ) . rejects . toThrowError ( "Missing Github signature header" ) ;
500+ ) . rejects . toThrow ( "Missing Github signature header" ) ;
501501
502502 //THEH
503503 expect ( prometheusIncrementAuthMock ) . not . toHaveBeenCalled ( ) ;
@@ -518,7 +518,7 @@ describe("middlewares/auth", () => {
518518 } ,
519519 { isGithubWebhook : true } ,
520520 ) ,
521- ) . rejects . toThrowError ( "Missing Github Webhook Secret" ) ;
521+ ) . rejects . toThrow ( "Missing Github Webhook Secret" ) ;
522522
523523 //THEH
524524 expect ( prometheusIncrementAuthMock ) . not . toHaveBeenCalled ( ) ;
@@ -542,7 +542,7 @@ describe("middlewares/auth", () => {
542542 } ,
543543 { isGithubWebhook : true } ,
544544 ) ,
545- ) . rejects . toThrowError (
545+ ) . rejects . toThrow (
546546 "Failed to authenticate Github webhook: could not validate" ,
547547 ) ;
548548
0 commit comments