From 20324f690834b4dd44eaadc9bca0d2b7a0495da4 Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Mon, 18 Mar 2024 10:34:48 -0400 Subject: [PATCH] test: use regex to check URL in validation error --- test/scenarios/errors.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/scenarios/errors.test.ts b/test/scenarios/errors.test.ts index d345c3a7..16713864 100644 --- a/test/scenarios/errors.test.ts +++ b/test/scenarios/errors.test.ts @@ -21,8 +21,10 @@ describe("api.github.com", () => { }) .catch((error) => { - expect(error.message).toEqual( - `Validation Failed: {"resource":"Label","code":"invalid","field":"color"} - http://localhost:3000/docs.github.com/k96d4icg0sn/rest/reference/issues#create-a-label`, + expect(error.message).toMatch( + new RegExp( + `Validation Failed: {"resource":"Label","code":"invalid","field":"color"} - http://localhost:3000/docs.github.com/[a-z0-9]{11}/rest/reference/issues#create-a-label`, + ), ); expect(error.response.data.errors).toEqual([ {