Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: v20 #305

Merged
merged 16 commits into from
Jul 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions test/scenarios/errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ describe("api.github.com", () => {
expect(error.message).toEqual(
`Validation Failed: {"resource":"Label","code":"invalid","field":"color"}`,
);
expect(error.response.data.errors).toStrictEqual([
{
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",
},
]),
);
Comment on lines +27 to +36
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same situation as in octokit/core.js#563

octokit/core.js#563 (comment)

This will need to be handled in a follow-up issue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 FAIL  test/scenarios/errors.test.ts
  ● api.github.com › (#684) errors-test

    expect(received).toStrictEqual(expected) // deep equality

    Expected: [{"code": "invalid", "field": "color", "resource": "Label"}]
    Received: serializes to the same string

      25 |           `Validation Failed: {"resource":"Label","code":"invalid","field":"color"}`,
      26 |         );
    > 27 |         expect(error.response.data.errors).toStrictEqual([
         |                                            ^
      28 |           {
      29 |             resource: "Label",
      30 |             code: "invalid",

      at test/scenarios/errors.test.ts:27:44

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in octokit/core.js#588

expect(error.response.data.documentation_url).toMatch(
new RegExp("rest/reference/issues#create-a-label"),
);
Expand Down