Skip to content

Commit

Permalink
test: use regex to check URL in validation error
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy1339 committed Mar 18, 2024
1 parent 37333e5 commit 20324f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/scenarios/errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([
{
Expand Down

0 comments on commit 20324f6

Please sign in to comment.