Skip to content

Commit

Permalink
test(refactor): use 'toEqual' instead of 'toStrictEqual' for Responses
Browse files Browse the repository at this point in the history
More context in octokit/core.js#588
  • Loading branch information
oscard0m committed Jul 19, 2023
1 parent 688f86a commit 9651fcd
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions test/scenarios/errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ describe("api.github.com", () => {
expect(error.message).toEqual(
`Validation Failed: {"resource":"Label","code":"invalid","field":"color"}`,
);
// To-Do: Figure out why the objects are not strictly equal
expect(JSON.stringify(error.response.data.errors)).toStrictEqual(
JSON.stringify([
{
resource: "Label",
code: "invalid",
field: "color",
},
]),
);
expect(error.response.data.errors).toEqual([
{
resource: "Label",
code: "invalid",
field: "color",
},
]);
expect(error.response.data.documentation_url).toMatch(
new RegExp("rest/reference/issues#create-a-label"),
);
Expand Down

0 comments on commit 9651fcd

Please sign in to comment.